com.partnersoft.cog
Class CogStructureType

java.lang.Object
  extended by com.partnersoft.cog.AbstractCogType
      extended by com.partnersoft.cog.CogStructureType
All Implemented Interfaces:
Coggable, CogType, Immutable

public class CogStructureType
extends AbstractCogType

Describes structure-like Cogs.

Copyright 2005-2006 Partner Software, Inc.

Version:
$Id: CogStructureType.java 2328 2010-01-06 15:38:22Z paul $
Author:
Paul Reavis, Russell Cagle

Constructor Summary
CogStructureType(Cog state)
           
CogStructureType(java.lang.String name, java.lang.String className)
          Creates a "stub" structure; it doesn't include any fields but is sufficient to load the given class as a coggable.
CogStructureType(java.lang.String name, java.lang.String className, java.lang.String controlName, Cog prototype, java.util.List<CogStructureField> fields)
           
 
Method Summary
 void cleanStructureOf(Cog node)
          Cleans the given node structure as best as it can based on available information.
 CogStructureField fieldNamed(java.lang.String fieldName)
          Returns the field corresponding to the given name.
 java.util.List<CogStructureField> getFields()
          Returns the list of field definitions, in their defined standard order.
 java.util.List<CogStructureField> listFieldsForGroup(java.lang.String group)
           
 java.util.List<java.lang.String> listGroups()
          Lists the names of the field groups.
 Cog toCog()
          Returns the complete internal state of this object in the form of a Cog.
 java.util.List<CogValidationException> validate(Cog node)
          Validates the given node structure as best it can.
 
Methods inherited from class com.partnersoft.cog.AbstractCogType
createNode, getControlName, getJavaClassName, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CogStructureType

public CogStructureType(Cog state)

CogStructureType

public CogStructureType(java.lang.String name,
                        java.lang.String className,
                        java.lang.String controlName,
                        Cog prototype,
                        java.util.List<CogStructureField> fields)

CogStructureType

public CogStructureType(java.lang.String name,
                        java.lang.String className)
Creates a "stub" structure; it doesn't include any fields but is sufficient to load the given class as a coggable.

Parameters:
name -
className -
Method Detail

cleanStructureOf

public void cleanStructureOf(Cog node)
Description copied from interface: CogType
Cleans the given node structure as best as it can based on available information. This typically involves setting the datatypes of children nodes.


validate

public java.util.List<CogValidationException> validate(Cog node)
Description copied from interface: CogType
Validates the given node structure as best it can.

Specified by:
validate in interface CogType
Overrides:
validate in class AbstractCogType
Parameters:
node - node to validate

toCog

public Cog toCog()
Description copied from interface: Coggable
Returns the complete internal state of this object in the form of a Cog.

Specified by:
toCog in interface Coggable
Overrides:
toCog in class AbstractCogType
Returns:
Cog representing the internal state of this object

getFields

public java.util.List<CogStructureField> getFields()
Returns the list of field definitions, in their defined standard order.


fieldNamed

public CogStructureField fieldNamed(java.lang.String fieldName)
Returns the field corresponding to the given name.

Parameters:
fieldName - name of desired field
Returns:
field with given name

listGroups

public java.util.List<java.lang.String> listGroups()
Lists the names of the field groups.


listFieldsForGroup

public java.util.List<CogStructureField> listFieldsForGroup(java.lang.String group)