com.partnersoft.cog
Interface CogType

All Superinterfaces:
Coggable, Immutable
All Known Implementing Classes:
AbstractCogType, CogCollectionType, CogEnumeratedType, CogPrimitiveType, CogStructureType

public interface CogType
extends Immutable, Coggable

A datatype for Cogs. Provides framework for configuration- and script-driven description, structure, validation, and defaults.

Note that CogTypes are designed to be immutable to prevent problems caused by errant scripts modifying the type definitions. However, they are also Coggable, so you can get their internal state, and you can save and load them as Cog XML and other Cog formats. However, trying to modify an existing CogType via setState() will result in an IllegalStateException.

Implementers should generally extend AbstractCogType, which defines basic behavior and properties for you.

Copyright 2005-2006 Partner Software, Inc.

Author:
Paul Reavis, Russell Cagle

Method Summary
 void cleanStructureOf(Cog cog)
          Cleans the given node structure as best as it can based on available information.
 Cog createNode()
          Creates a new node of this type.
 java.lang.String getControlName()
          Name of GUI or web control to use to edit this type.
 java.lang.String getJavaClassName()
          Name of Java class associated with this type.
 java.lang.String getName()
          Name of the type, used for lookups in an CogSchema.
 java.util.List<CogValidationException> validate(Cog node)
          Validates the given node structure as best it can.
 
Methods inherited from interface com.partnersoft.cog.Coggable
toCog
 

Method Detail

cleanStructureOf

void cleanStructureOf(Cog cog)
Cleans the given node structure as best as it can based on available information. This typically involves setting the datatypes of children nodes.


validate

java.util.List<CogValidationException> validate(Cog node)
Validates the given node structure as best it can.

Parameters:
node - node to validate

createNode

Cog createNode()
Creates a new node of this type. Generally this is done by copying a prototype value but may involve some other mechanism.


getName

java.lang.String getName()
Name of the type, used for lookups in an CogSchema.

Returns:
the name of this type.

getJavaClassName

java.lang.String getJavaClassName()
Name of Java class associated with this type. May be null. If present, you can generally instantiate the class given.

Returns:
class name associated with this type
See Also:
Coggable

getControlName

java.lang.String getControlName()
Name of GUI or web control to use to edit this type.

Returns:
name of gui or web control to use for editing
See Also:
Coggable