|
||||||||||
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.Attribute
public class Attribute
A declaration of an attribute.
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 | |
---|---|
Attribute()
Constructs a new instance which will require subsequent initialisation. |
|
Attribute(String name,
int minCardinality,
int maxCardinality,
Attribute ref,
DataModel model)
Constructs a new instance with the specified reference and other values. |
|
Attribute(String name,
int minCardinality,
int maxCardinality,
Class typeClass,
DataModel model)
Constructs a new lazily initialised instance with the specified type class and other values. |
|
Attribute(String name,
int minCardinality,
int maxCardinality,
SimpleDataType type,
DataModel model)
Constructs a new instance with the specified type and other values. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
String |
formatObject(Object obj)
Returns a String representation of the supplied Object. |
Attribute |
getAttributeRef()
Retuns the attribute ref. |
FormEnum |
getForm(boolean deep)
Returns the form of this component or optionally the model's default. |
SimpleDataType |
getSimpleType()
Returns the type of this attribute as a simple type. |
int |
hashCode()
|
Object |
parseObject(String str)
Returns an Object representation of the supplied String data. |
void |
setMaxCardinality(int maxCardinality)
Sets the maximum cardinality of this attribute. |
void |
setMinCardinality(int minCardinality)
Sets the minimum cardinality of this attribute. |
void |
setRef(DataComponent ref)
Sets the ref of this attribute. |
void |
setType(DataType type)
Sets the type of this attribute. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Attribute()
public Attribute(String name, int minCardinality, int maxCardinality, Class typeClass, DataModel model)
name
- The name of the attribute.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.typeClass
- The class of the type of the attribute.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 Attribute(String name, int minCardinality, int maxCardinality, SimpleDataType type, DataModel model)
name
- The name of the attribute.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.type
- The type of the attribute.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 Attribute(String name, int minCardinality, int maxCardinality, Attribute ref, DataModel model)
name
- The name of the attribute.minCardinality
- The minimum cardinality.maxCardinality
- The maximum cardinality or DataComponent.CARDINALITY_UNBOUNDED
.ref
- The attribute 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.
IllegalArgumentException
- if the type of ref is not a SimpleDataType
.Method Detail |
---|
public Attribute getAttributeRef()
public SimpleDataType getSimpleType()
public void setType(DataType type)
setType
in class DataComponent
type
- The new type.
IllegalArgumentException
- if type is not a SimpleDataType
.public void setRef(DataComponent ref)
setRef
in class DataComponent
ref
- The new ref.
IllegalArgumentException
- if the type of ref is not a SimpleDataType
.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 void setMinCardinality(int minCardinality)
setMinCardinality
in class DataComponent
minCardinality
- The new value.
IllegalArgumentException
- if minimum cardinality is less than zero or greater than one.public void setMaxCardinality(int maxCardinality)
setMaxCardinality
in class DataComponent
maxCardinality
- The new value.
IllegalArgumentException
- if maximum cardinality is less than zero or greater than one.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.
public boolean equals(Object o)
equals
in class DataComponent
public int hashCode()
hashCode
in class DataComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |