|
Vordel SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vordel.es.EntityTypeImpl
public class EntityTypeImpl
The type definition for Entities in the EntityStore
framework
| Field Summary |
|---|
| Fields inherited from interface com.vordel.es.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 Summary | |
|---|---|
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 |
|
| Method Summary | |
|---|---|
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(java.lang.Object 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()
|
static 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()
Get all the key field names |
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 |
hasSuperType(java.lang.String candidate)
Check to see if the specified type is an ancestor of this type |
boolean |
isAbstract()
See if this type is abstract. |
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 |
isKeyField(Field f)
|
boolean |
isSubType(EntityType candidate)
Check that the specified type is a subtype of this type. |
java.lang.String |
serialize()
Deprecated. Serialising XML to strings is evil. replaced by (write) |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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 definition
EntityStoreException
public 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 definition
EntityStoreException
public EntityTypeImpl(TypeStore ts,
org.w3c.dom.Node doc)
throws EntityStoreException
ts - doc -
EntityStoreException| Method Detail |
|---|
public org.w3c.dom.Element getRootElement()
getRootElement in interface EntityType
public static javax.xml.parsers.DocumentBuilder getBuilder()
throws EntityStoreException
EntityStoreException
protected 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 field
public 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 type
public void write(java.io.OutputStream os)
throws java.io.IOException
write in interface EntityTypejava.io.IOException
public static void write(java.io.OutputStream os,
java.lang.String encoding,
org.w3c.dom.Node node)
throws java.io.IOException
java.io.IOException
public java.lang.String serialize()
throws EntityStoreException
serialize in interface EntityTypeEntityStoreExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isSubType(EntityType candidate)
isSubType in interface EntityTypecandidate - The candidate type
public boolean hasSuperType(java.lang.String candidate)
EntityType
hasSuperType in interface EntityType
public 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 Field
EntityStoreException - If the values are incompatible with the
type definition
public 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 value
EntityStoreException - If the values are incompatible with the
type definition
public Field createField(java.lang.String fieldName,
ESPK reference)
throws EntityStoreException
createField in interface EntityTypefieldName - The name of the field to createreference - A single data reference
EntityStoreException - 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 -
public int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparablepublic boolean isKeyField(Field f)
isKeyField in interface EntityTypepublic boolean allowsSoftReferences()
allowsSoftReferences in interface EntityTypepublic boolean extendsType(java.lang.String parentType)
extendsType in interface EntityType
|
Vordel SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||