com.partnersoft.cog
Class AbstractCogType

java.lang.Object
  extended by com.partnersoft.cog.AbstractCogType
All Implemented Interfaces:
Coggable, CogType, Immutable
Direct Known Subclasses:
CogCollectionType, CogEnumeratedType, CogPrimitiveType, CogStructureType

public abstract class AbstractCogType
extends java.lang.Object
implements CogType

A generic implementation of CogType that takes care of a few minor details for you.

Subclasses must call the superclass versions when implementing the Coggable methods.

Copyright 2006-2009 Partner Software, Inc.

Version:
$Id: AbstractCogType.java 2328 2010-01-06 15:38:22Z paul $
Author:
Paul Reavis

Constructor Summary
AbstractCogType(Cog state)
           
AbstractCogType(java.lang.String name, java.lang.String javaClassName, java.lang.String controlName, Cog prototype)
           
 
Method Summary
 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.
 Cog toCog()
          Returns the complete internal state of this object in the form of a Cog.
 java.lang.String toString()
           
 java.util.List<CogValidationException> validate(Cog node)
          Validates the given node structure as best it can.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.partnersoft.cog.CogType
cleanStructureOf
 

Constructor Detail

AbstractCogType

public AbstractCogType(Cog state)

AbstractCogType

public AbstractCogType(java.lang.String name,
                       java.lang.String javaClassName,
                       java.lang.String controlName,
                       Cog prototype)
Method Detail

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
Returns:
Cog representing the internal state of this object

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
Parameters:
node - node to validate

createNode

public Cog createNode()
Description copied from interface: CogType
Creates a new node of this type. Generally this is done by copying a prototype value but may involve some other mechanism.

Specified by:
createNode in interface CogType

getName

public java.lang.String getName()
Description copied from interface: CogType
Name of the type, used for lookups in an CogSchema.

Specified by:
getName in interface CogType
Returns:
the name of this type.

getJavaClassName

public java.lang.String getJavaClassName()
Description copied from interface: CogType
Name of Java class associated with this type. May be null. If present, you can generally instantiate the class given.

Specified by:
getJavaClassName in interface CogType
Returns:
class name associated with this type
See Also:
Coggable

getControlName

public java.lang.String getControlName()
Description copied from interface: CogType
Name of GUI or web control to use to edit this type.

Specified by:
getControlName in interface CogType
Returns:
name of gui or web control to use for editing
See Also:
Coggable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object