public class EntityTypeImpl extends java.lang.Object implements EntityType
ABSTRACT, CARDINALITY, COMPONENT_TYPE, CONSTANT, DEFAULT, DEFAULT_REF, DEFAULT_VALUE, ENTITY_TYPE, EXTENDS, FIELD, IS_KEY, NAME, ONE_OR_MANY, TYPE, VSTAMP, ZERO_OR_MANY, ZERO_OR_ONE| Constructor and Description |
|---|
EntityTypeImpl(TypeStore ts,
java.io.InputStream stream)
Create a new EntityType
|
EntityTypeImpl(TypeStore ts,
org.w3c.dom.Node doc)
Create a new EntityType from a Document model
|
EntityTypeImpl(TypeStore ts,
java.lang.String schema)
Create a new EntityType
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsChildEntities()
Does this type allow child Entities
|
boolean |
allowsComponent(EntityType t)
Does this type allow entities of the specified type?
|
boolean |
allowsReferences() |
boolean |
allowsSoftReferences() |
int |
compareTo(EntityType other) |
Field |
createField(java.lang.String fieldName,
ESPK reference)
Convienence method for creating a Field based on the FieldType as
defined by this EntityType definition
|
Field |
createField(java.lang.String fieldName,
java.lang.String value)
Convienence method for creating a Field based on the FieldType as
defined by this EntityType definition
|
Field |
createField(java.lang.String fieldName,
Value[] vals)
Convienence method for creating a Field based on the FieldType as
defined by this EntityType definition
|
boolean |
equals(java.lang.Object other)
Equality is based on type name.
|
boolean |
extendsType(java.lang.String parentType) |
java.util.Collection<java.lang.String> |
getAllConstantFieldNames() |
java.util.Collection<Field> |
getAllConstantFields() |
java.util.Set<java.lang.String> |
getAllDeclaredConstantFieldNames() |
java.util.Set<java.lang.String> |
getAllDeclaredFieldNames()
Get all fields defined for this type, excluding superTypes.
|
java.util.Collection<java.lang.String> |
getAllDeclaredKeyFields() |
java.util.Collection<java.lang.String> |
getAllDefaultedFieldNames() |
java.util.Collection<java.lang.String> |
getAllFieldNames() |
javax.xml.parsers.DocumentBuilder |
getBuilder() |
Field |
getConstantField(java.lang.String fieldName)
Get the constant field with the name 'fieldName'
|
java.util.Map<java.lang.String,java.lang.Object> |
getDeclaredComponentTypes()
Get a copy of the component type map for this type
Key is component type name
Value is the cardinality of allowed occurrances under a node of this type
|
FieldType |
getFieldType(java.lang.String name)
Get the field type for the specified field name.
|
java.lang.String[] |
getKeyFieldNames() |
java.lang.String |
getName()
Get the name of this type.
|
org.w3c.dom.Element |
getRootElement() |
EntityType |
getSuperType()
Get the super type of this type.
|
int |
hashCode() |
boolean |
isAbstract()
See if this type is abstract.
|
boolean |
isAncestorOfType(EntityType candidate)
Check that this type is an ancestor of the specified type
|
boolean |
isCompatible(EntityType other)
Compatibility is a check that the contents of an Entity of this
type can be applied safely to the contents of an Entity of another
compatible type.
|
boolean |
isConstantField(java.lang.String fieldName) |
boolean |
isDescendantOfType(java.lang.String candidate)
Check to see if this type is a descendant of the specified type.
|
boolean |
isKeyField(Field f) |
java.lang.String |
toString()
The name of the type is the preferred representation
|
protected void |
validate() |
void |
write(java.io.OutputStream os) |
static void |
write(java.io.OutputStream os,
java.lang.String encoding,
org.w3c.dom.Node node) |
public EntityTypeImpl(TypeStore ts, java.io.InputStream stream) throws EntityStoreException
ts - A Type store from where to wire up the inheritance hierarchystream - An input stream from where to obtain the type's definitionEntityStoreExceptionpublic EntityTypeImpl(TypeStore ts, java.lang.String schema) throws EntityStoreException
ts - A Type store from where to wire up the inheritance hierarchyschema - A string representing the type's definitionEntityStoreExceptionpublic EntityTypeImpl(TypeStore ts, org.w3c.dom.Node doc) throws EntityStoreException
ts - The TypeStore, containing possible ancestor EntityTypesdoc - The root node of the EntityType definitionEntityStoreExceptionpublic org.w3c.dom.Element getRootElement()
getRootElement in interface EntityTypepublic javax.xml.parsers.DocumentBuilder getBuilder()
throws EntityStoreException
getBuilder in interface EntityTypeEntityStoreExceptionprotected void validate()
throws EntityStoreException
EntityStoreExceptionpublic java.util.Map<java.lang.String,java.lang.Object> getDeclaredComponentTypes()
getDeclaredComponentTypes in interface EntityTypepublic java.util.Set<java.lang.String> getAllDeclaredFieldNames()
getAllDeclaredFieldNames in interface EntityTypepublic java.util.Set<java.lang.String> getAllDeclaredConstantFieldNames()
getAllDeclaredConstantFieldNames in interface EntityTypepublic java.util.Collection<java.lang.String> getAllDeclaredKeyFields()
getAllDeclaredKeyFields in interface EntityTypepublic FieldType getFieldType(java.lang.String name)
getFieldType in interface EntityTypename - The name of the fieldpublic boolean isConstantField(java.lang.String fieldName)
isConstantField in interface EntityTypepublic boolean allowsReferences()
allowsReferences in interface EntityTypepublic Field getConstantField(java.lang.String fieldName)
getConstantField in interface EntityTypepublic java.util.Collection<Field> getAllConstantFields()
getAllConstantFields in interface EntityTypepublic java.util.Collection<java.lang.String> getAllDefaultedFieldNames()
getAllDefaultedFieldNames in interface EntityTypepublic java.util.Collection<java.lang.String> getAllFieldNames()
getAllFieldNames in interface EntityTypepublic java.util.Collection<java.lang.String> getAllConstantFieldNames()
getAllConstantFieldNames in interface EntityTypepublic EntityType getSuperType()
getSuperType in interface EntityTypepublic boolean isAbstract()
isAbstract in interface EntityTypepublic java.lang.String getName()
getName in interface EntityTypepublic java.lang.String[] getKeyFieldNames()
getKeyFieldNames in interface EntityTypepublic boolean allowsChildEntities()
allowsChildEntities in interface EntityTypepublic boolean allowsComponent(EntityType t)
allowsComponent in interface EntityTypet - The candidate child typepublic void write(java.io.OutputStream os)
throws java.io.IOException
write in interface EntityTypejava.io.IOExceptionpublic static void write(java.io.OutputStream os,
java.lang.String encoding,
org.w3c.dom.Node node)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isAncestorOfType(EntityType candidate)
EntityTypeisAncestorOfType in interface EntityTypecandidate - The candidate typepublic boolean isDescendantOfType(java.lang.String candidate)
EntityTypeisDescendantOfType in interface EntityTypecandidate - The type to checkpublic Field createField(java.lang.String fieldName, Value[] vals) throws EntityStoreException
createField in interface EntityTypefieldName - The name of the field to createvals - The initial values of the FieldEntityStoreException - If the values are incompatible with the
type definitionpublic Field createField(java.lang.String fieldName, java.lang.String value) throws EntityStoreException
createField in interface EntityTypefieldName - The name of the field to createvalue - A single data valueEntityStoreException - If the values are incompatible with the
type definitionpublic Field createField(java.lang.String fieldName, ESPK reference) throws EntityStoreException
createField in interface EntityTypefieldName - The name of the field to createreference - A single data referenceEntityStoreException - If the values are incompatible with the
type definitionpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic boolean isCompatible(EntityType other)
isCompatible in interface EntityTypeother - The EntityType to compare with this one.public int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(EntityType other)
compareTo in interface java.lang.Comparable<EntityType>public boolean isKeyField(Field f)
isKeyField in interface EntityTypepublic boolean allowsSoftReferences()
allowsSoftReferences in interface EntityTypepublic boolean extendsType(java.lang.String parentType)
extendsType in interface EntityType
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel