com.partnersoft.cog
Class CogSchema

java.lang.Object
  extended by com.partnersoft.cog.CogSchema
Direct Known Subclasses:
CogBootstrapSchema, MapsCogSchema, XyCogSchema

public class CogSchema
extends java.lang.Object

A CogSchema defines the data dictionary for a set of related cogs, such as in a Codex. It defines CogTypes, which provide metadata, validation, etc. functions for Cogs and Cog-based frameworks.

Author:
Russell Cagle, Paul Reavis Copyright 2006 Partner Software, Inc.

Constructor Summary
CogSchema()
          Creates an empty CogSchema.
CogSchema(CogSchema parentSchema)
          Creates a CogSchema which inherits types from the given parent schema.
 
Method Summary
 void addInheritedSchema(CogSchema newSchema)
           
 void addStubStructure(java.lang.String typeName, java.lang.String coggableClassName)
          Add a basic structure definition for the given Coggable class name.
 void addType(CogType newType)
           
 Cog createNode(java.lang.String typeName)
          Creates a Cog with default values for the given named type.
 java.util.List<CogSchema> getInheritedSchemas()
           
 Naming<CogType> getTypes()
           
 java.util.List<CogSchema> listInheritedSchemas()
           
 void setTypes(Naming<CogType> newTypes)
           
 CogType typeNamed(java.lang.String name)
          Looks up a type by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CogSchema

public CogSchema()
Creates an empty CogSchema.


CogSchema

public CogSchema(CogSchema parentSchema)
Creates a CogSchema which inherits types from the given parent schema.

Method Detail

typeNamed

public CogType typeNamed(java.lang.String name)
Looks up a type by name. Refers to the parent if necessary; also deals with parameterized types (e.g. "List-of-Something").

Parameters:
name - name of Cog datatype.
Returns:
type for given name.

createNode

public Cog createNode(java.lang.String typeName)
Creates a Cog with default values for the given named type. This is done using the prototype value stored in the CogType.

Parameters:
typeName - name of type used to create node.
Returns:
node of the given type with default values.

addType

public void addType(CogType newType)

addInheritedSchema

public void addInheritedSchema(CogSchema newSchema)

addStubStructure

public void addStubStructure(java.lang.String typeName,
                             java.lang.String coggableClassName)
Add a basic structure definition for the given Coggable class name. This doesn't include the field names, so isn't sufficient to build a form or do validation, but is sufficient to load the Coggable from XML.


getTypes

public Naming<CogType> getTypes()

setTypes

public void setTypes(Naming<CogType> newTypes)

listInheritedSchemas

public java.util.List<CogSchema> listInheritedSchemas()

getInheritedSchemas

public java.util.List<CogSchema> getInheritedSchemas()