|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.DataComponent
biz.c24.io.api.data.Element
public class Element
A declaration of an element.
Instances of this class are used to build up the structure of a ComplexDataType
.
This class encapsulates a type and the minimum and maximum cardinality of objects of that type WITHIN a particular scope.
This class is responsible for the validation of cardinalities.
Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.
Field Summary |
---|
Fields inherited from class biz.c24.io.api.data.DataComponent |
---|
CARDINALITY_UNBOUNDED, IO_VALIDATE_DATABASE_KEY_PRESENCE |
Constructor Summary | |
---|---|
Element()
Constructs a new instance which will require subsequent initilisation. |
|
Element(String name,
int minCardinality,
int maxCardinality,
Class typeClass,
DataModel model)
Constructs a new lazily initalised instance with the specified type class and other values. |
|
Element(String name,
int minCardinality,
int maxCardinality,
DataType type,
DataModel model)
Constructs a new instance with the specified type and other values. |
|
Element(String name,
int minCardinality,
int maxCardinality,
Element ref,
DataModel model)
Constructs a new instance with the specified reference and other values. |
Method Summary | |
---|---|
void |
addDatabaseKeyRef(DatabaseKeyRef databaseKeyRef)
Adds a new database key reference that will allow for correct construction of database relationships between parent and child objects. |
void |
addSubstitution(Element substitution)
Adds an element to this elements substitution group. |
Object |
createObject(String typeName,
String typeUri)
Creates an returns a new object defined by this component and a type derived from this components type. |
String |
formatObject(Object obj)
Returns a String representation of the supplied Object. |
BitMapIndex |
getBitMapIndex()
|
ElementBlockEnum |
getBlock()
Returns the block value of this element. |
DatabaseKeyRef |
getDatabaseKeyRef(int index)
Returns the database key reference at the specified index. |
int |
getDatabaseKeyRefCount()
Returns the number of database key references on this element. |
DatabaseKeyRef[] |
getDatabaseKeyRefs()
Returns all database key references specified on this element. |
Element |
getElementRef()
Returns the element ref. |
FinalEnum |
getFinal()
Returns the final value of this element. |
FormEnum |
getForm(boolean deep)
Returns the form of this component or optionally the model's default. |
Element |
getSubstitution(int index)
Returns the substitution at index . |
Element |
getSubstitution(String name)
Returns the substitution called name . |
Element |
getSubstitution(String name,
String namespace)
Returns the substitution called name from namespace . |
int |
getSubstitutionCount()
Returns the number of substitions in this elements substitution group. |
Element |
getSubstitutionGroup()
Returns the head of this elements substitution group. |
boolean |
isAbstract()
Returns whether this element is abstract. |
boolean |
isComposition()
Returns whether this element represents a composition (strong) relationship or an aggregation (weak) relationship. |
boolean |
isIdentifier()
|
boolean |
isNillable()
Returns whether this element permits nill objects. |
Object |
parseObject(String str)
Returns an Object representation of the supplied String data. |
void |
removeDatabaseKeyRef(DatabaseKeyRef databaseKeyRef)
Removes a specified database key reference from this element. |
void |
removeSubstitution(Element substitution)
Removes an element from this elements substitution group. |
void |
setAbstract(boolean abstracT)
Sets whether this element is abstract. |
void |
setBitMapIndex(BitMapIndex bitMapIndex)
|
void |
setBlock(ElementBlockEnum block)
Sets the block value of this element. |
void |
setComposition(boolean composition)
Sets whether this element represents a composition (strong) relationship or an aggregation (weak) relationship. |
void |
setDatabaseKeyRefs(DatabaseKeyRef[] databaseKeyRefs)
Sets the database key references on this element. |
void |
setFinal(FinalEnum finaL)
Sets the final value of this element. |
void |
setIdentifier(boolean identifier)
|
void |
setNillable(boolean nillable)
Sets whether this element permits nill objects. |
void |
setSubstitutionGroup(Element substitutionGroup)
Sets the head of this elements substitution group. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Element()
public Element(String name, int minCardinality, int maxCardinality, Class typeClass, DataModel model)
name
- The name of the element.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.typeClass
- The class of the type of the element.model
- The model.
NullPointerException
- if name or model are null.
IllegalArgumentException
- if minimum or maximum cardinality are less than zero or greater than one or if minimum cardinality is greater than maximum cardinality.public Element(String name, int minCardinality, int maxCardinality, DataType type, DataModel model)
name
- The name of the element.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.type
- The type of the element.model
- The model.
NullPointerException
- if name or model are null.
IllegalArgumentException
- if minimum or maximum cardinality are less than zero or greater than one or if minimum cardinality is greater than maximum cardinality.public Element(String name, int minCardinality, int maxCardinality, Element ref, DataModel model)
name
- The name of the element.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.ref
- The element to refer to.model
- The model.
NullPointerException
- if name or model are null.
IllegalArgumentException
- if minimum or maximum cardinality are less than zero or greater than one or if minimum cardinality is greater than maximum cardinality.Method Detail |
---|
public Object createObject(String typeName, String typeUri)
DataComponent
createObject
in class DataComponent
typeName
- The name of the type to use.typeUri
- The URI of the namespace of the type to use.
public Element getElementRef()
public FormEnum getForm(boolean deep)
DataComponent
getForm
in class DataComponent
deep
- Whether to return the model's default form if this component's form is FormEnum.UNSPECIFIED
.
public boolean isAbstract()
public void setAbstract(boolean abstracT)
abstracT
- The new value.public ElementBlockEnum getBlock()
public void setBlock(ElementBlockEnum block)
block
- The new block value.public FinalEnum getFinal()
public void setFinal(FinalEnum finaL)
finaL
- The new final value.public boolean isNillable()
public void setNillable(boolean nillable)
nillable
- The new value.public Element getSubstitutionGroup()
public void setSubstitutionGroup(Element substitutionGroup)
substitutionGroup
- The substitution group.public void addSubstitution(Element substitution)
substitution
- The new substition.public void removeSubstitution(Element substitution)
substitution
- The substitution to be removed.public Element getSubstitution(String name)
name
.getSubstitution(String, String)
with null
as the second argument.
name
- The name of the substitution.
public Element getSubstitution(String name, String namespace)
name
from namespace
.
name
- The name of the substitution.namespace
- The namespace URI of the substitutions model.
public Element getSubstitution(int index)
index
.
index
- The index.
public int getSubstitutionCount()
public boolean isComposition()
public void setComposition(boolean composition)
composition
- The new value.public boolean isIdentifier()
public void setIdentifier(boolean identifier)
public DatabaseKeyRef[] getDatabaseKeyRefs()
public void setDatabaseKeyRefs(DatabaseKeyRef[] databaseKeyRefs)
databaseKeyRefs
- The new database key references.public int getDatabaseKeyRefCount()
public DatabaseKeyRef getDatabaseKeyRef(int index)
index
- The index.
public void addDatabaseKeyRef(DatabaseKeyRef databaseKeyRef)
databaseKeyRef
- The database key reference to be added.public BitMapIndex getBitMapIndex()
public void setBitMapIndex(BitMapIndex bitMapIndex)
public void removeDatabaseKeyRef(DatabaseKeyRef databaseKeyRef)
databaseKeyRef
- The database key reference to be removed.public Object parseObject(String str) throws ParserException
DataComponent
parseObject
in class DataComponent
str
- The data to be parsed.
ParserException
- If the data in the supplied String cannot be suitably rendered according to the type of this component.public String formatObject(Object obj)
DataComponent
formatObject
in class DataComponent
obj
- The object representing the instance of this component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |