biz.c24.io.api.data
Class ComplexDataType

java.lang.Object
  extended by biz.c24.io.api.data.DataType
      extended by biz.c24.io.api.data.ComplexDataType
All Implemented Interfaces:
ModelComponent, Serializable
Direct Known Subclasses:
SwiftFieldDataType

public class ComplexDataType
extends DataType

A data type constructed from other data types.

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.

See Also:
ComplexDataObject, Serialized Form

Field Summary
 
Fields inherited from class biz.c24.io.api.data.DataType
duringParsing, hasEnumerations, hasPatternMatching, qualifierValidation
 
Constructor Summary
ComplexDataType()
          Constructs a new instance.
 
Method Summary
 void addAttrDecl(Attribute attr)
          Adds a attribute declaration to the structure of this object.
 void addElementDecl(Element element)
          Adds an element declaration.
 void addIdGeneratorParameter(IDGeneratorParameter parameter)
          Adds and IDGeneratorParameter to the list.
 boolean containsAttrDecl(String name)
          Returns whether this type contains a attribute called name.
 boolean containsElementDecl(String name)
          Returns whether this type contains an element declaration called name
protected  Object createObject(DataComponent definingDataComponentDecl)
           
 AlignToBorder getAlignToBorder()
           
 Attribute getAttrDecl(int index)
          Returns the attribute declaration at index.
 Attribute getAttrDecl(String name)
          Returns the attribute declaration called name.
 int getAttrDeclCount()
          Returns the total number of attribute present in this types structure.
 int getAttrDeclIndex(Attribute attr)
          Returns the index of attribute.
 ComplexDataType getBaseType()
          Returns the base type.
 BitMap getBitMap()
           
 TypeBlockEnum getBlock()
          Returns the block value.
 String getChildSequenceColumnName()
          Returns the name of the child, that represents the column in a database, that will be used to store the order of the children.
 ContentModelEnum getContentModel()
          Returns the content model.
 SimpleDataType getContentType()
          Returns the content type.
 String[] getDelimiter()
          Returns the delimiter(s).
 String[] getDelimiterFieldWrapper()
          Returns the delimiter field wrapper(s).
 DelimiterLocationEnum getDelimiterLocation()
          Returns the location of the delimiter.
 Element getElementDecl(int index)
          Returns the element declaration at index.
 Element getElementDecl(String name)
          Returns the element declaration called name.
 int getElementDeclCount()
          Returns the total number of elements present in this types structure.
 int getElementDeclIndex(Element element)
          Returns the index of an element declaration.
 FinalEnum getFinal()
          Returns the final value.
 FormatTypeEnum getFormatType()
          Returns the format type.
 IDGeneratorMethodEnum getIdGenerator()
          returns the Hibernate Id generator method to be used.
 int getIdGeneratorParameterIndex(IDGeneratorParameter parameter)
          Returns the location of the specified IDGeneratorParameter, of where it will appear when applied to the Id Generator.
 IDGeneratorParameter[] getIdGeneratorParameters()
          Returns all the Id Generator parameters as an array of IDGeneratorParameter.
 Attribute getNativeAttrDecl(int index)
          Return the native attribute declaration at index.
 int getNativeAttrDeclCount()
          Returns the number of native attributes (i.e. not inherited from the base type).
 int getNativeAttrDeclIndex(Attribute attr)
          Returns the index of native attribute declaration.
 Element getNativeElementDecl(int index)
          Returns the native element at index.
 int getNativeElementDeclCount()
          Returns the number of elements native to this type (i.e. not inherited from the base type).
 int getNativeElementDeclIndex(Element element)
          Returns the index of a native element declaration.
 ComplexDataType getOrderingType()
          Returns the ordering type.
 Class getValidObjectClass()
          Returns the class of valid objects of this type.
 boolean isAbstract()
          Returns whether this type is abstract.
 boolean isAttributeGroup()
          Returns whether this type is an attribute group.
 boolean isCollated()
          Returns whether this type is collated.
 boolean isComplex()
          Returns whether this type is complex.
 boolean isDelimiterPlaceholder()
          Returns whether the delimiter uses placeholders.
 boolean isElementGroup()
          Returns whether this type is an element group.
 boolean isExcludeFromDatabase()
          Returns whether this object should be excluded from database persistence.
 boolean isExtension()
          Returns whether this type has a base type and if so whether it is an extension of it.
 boolean isMixed()
          Returns whether this type is mixed.
 boolean isProcessAsBatch()
          Gets whether this type should be processsed as a batch.
 boolean isRestriction()
          Returns whether this type has a base type and if so whether it is a restriction of it.
 boolean isSimple()
          Returns whether this type is simple.
 boolean isUrType()
          Sets whether this type represents a UR-type.
 Element lookupExpectedElement(InputStream stream, Element docRoot, ComplexDataType docRootType)
          Expected element discovery callback.
 void removeAttrDecl(Attribute attr)
          Removes the attribute declaration.
 void removeAttrDecl(int index)
          Removes the attribute declaration at index i.
 void removeElementDecl(Element element)
          Removes an element declaration.
 void removeElementDecl(int index)
          Removes the element declaration at index i.
 void removeIdGeneratorParameter(IDGeneratorParameter parameter)
          Removes the specified parameter.
 void setAbstract(boolean abstracT)
          Sets whether this type is abstract.
 void setAlignToBorder(AlignToBorder alignToBorder)
           
 void setAttributeGroup(boolean attributeGroup)
          Sets whether this type is an attribute group.
 void setBaseType(ComplexDataType baseType)
          Sets the base type.
 void setBitMap(BitMap bitMap)
           
 void setBlock(TypeBlockEnum block)
          Sets the block value.
 void setChildSequenceColumnName(String childSequenceColumnName)
          Sets the name of the child, that represents the column in a database, that will be used to store the order of the children.
 void setCollated(boolean collated)
          Sets whether this field would like its subfields collated.
 void setContentModel(ContentModelEnum contentModel)
          Sets the content model.
 void setContentType(SimpleDataType contentType)
          Sets the content type.
 void setDelimiter(String[] delimiter)
          Sets the delimiter(s).
 void setDelimiterFieldWrapper(String[] delimiterFieldWrapper)
          Sets the delimiter field wrapper(s).
 void setDelimiterLocation(DelimiterLocationEnum delimiterLocation)
          Sets the delimiter's location.
 void setDelimiterPlaceholder(boolean delimiterPlaceholder)
          Sets the delimiter's status as a placeholder or not.
 void setElementGroup(boolean elementGroup)
          Sets whether this type is an element group.
 void setExcludeFromDatabase(boolean excludeFromDatabase)
          Sets whether this object should be excluded from database persistence.
 void setExtension(boolean extension)
          Sets whether this type is an extension.
 void setFinal(FinalEnum finaL)
          Sets the final value.
 void setFormatType(FormatTypeEnum formatType)
          Sets the format type.
 void setIdGenerator(IDGeneratorMethodEnum idGenerator)
          sets the Hibernate ID generation method to be used.
 void setIdGeneratorParameterAt(IDGeneratorParameter parameter, int index)
          Sets the parameter at a specified index.
 void setMixed(boolean mixed)
          Sets whether this type is mixed.
 void setOrderingType(ComplexDataType orderingType)
          Sets the ordering type.
 void setProcessAsBatch(boolean processAsBatch)
          Sets whether this type should be processed as a batch.
 void setRestriction(boolean restriction)
          Sets whether this type is a restriction.
 void setUrType(boolean urType)
          Sets whether this is a UR-type.
 void setValidObjectClass(Class validObjectClass)
          Sets the valid object class.
 boolean validateProperties(Object object, DataComponent comp, ComplexDataObject context, ValidationManager manager)
           
 
Methods inherited from class biz.c24.io.api.data.DataType
addDerivedType, addValidator, addValidator, derivedTypeKeySet, getAnnotation, getDatabaseColumnName, getDerivedType, getDerivedType, getDerivedTypes, getDescription, getEnumeration, getInitiator, getModel, getName, getNullDefiningElementDecl, getOriginalName, getOriginalPatternMatch, getPatternMatch, getPatternType, getTerminator, getValidator, getValidatorCount, getValidatorIndex, hasDerivedTypes, isLocal, isValidObjectClass, removeDerivedType, removeValidator, setAnnotation, setDatabaseColumnName, setInitiator, setLocal, setModel, setName, setOriginalName, setOriginalPatternMatch, setPatternMatch, setPatternType, setTerminator, toString, validate, validateProperties, validateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexDataType

public ComplexDataType()
Constructs a new instance.

Method Detail

isComplex

public boolean isComplex()
Description copied from class: DataType
Returns whether this type is complex.

Overrides:
isComplex in class DataType
Returns:
Whether this type is complex.

isSimple

public boolean isSimple()
Description copied from class: DataType
Returns whether this type is simple. Note: a complex type can return true from this method if it is derived from a simple type.

Overrides:
isSimple in class DataType
Returns:
Whether this type is simple.

createObject

protected Object createObject(DataComponent definingDataComponentDecl)

getValidObjectClass

public Class getValidObjectClass()
Description copied from class: DataType
Returns the class of valid objects of this type.

Overrides:
getValidObjectClass in class DataType
Returns:
The class.

setValidObjectClass

public void setValidObjectClass(Class validObjectClass)
Sets the valid object class.

Parameters:
validObjectClass - The new value.

getBaseType

public ComplexDataType getBaseType()
Returns the base type.

Returns:
The base type.

setBaseType

public void setBaseType(ComplexDataType baseType)
Sets the base type.

Parameters:
baseType - The new base type.

getFinal

public FinalEnum getFinal()
Returns the final value. The final value controls how this type can be derived.

Returns:
The final value.

setFinal

public void setFinal(FinalEnum finaL)
Sets the final value.

Parameters:
finaL - The new value.

getBlock

public TypeBlockEnum getBlock()
Returns the block value. The block value controls which derivations of this type are allowed.

Returns:
The block value.

setBlock

public void setBlock(TypeBlockEnum block)
Sets the block value.

Parameters:
block - The new block value.

isExtension

public boolean isExtension()
Returns whether this type has a base type and if so whether it is an extension of it.

Returns:
Whether this type is an extension.

setExtension

public void setExtension(boolean extension)
Sets whether this type is an extension.

Parameters:
extension - The new value.

isRestriction

public boolean isRestriction()
Returns whether this type has a base type and if so whether it is a restriction of it.

Returns:
Whether this type is an restriction.

setRestriction

public void setRestriction(boolean restriction)
Sets whether this type is a restriction.

Parameters:
restriction - The new value.

getContentModel

public final ContentModelEnum getContentModel()
Returns the content model. The content model specifies the order and required presence of elements.

Returns:
The content model.

setContentModel

public void setContentModel(ContentModelEnum contentModel)
Sets the content model.

Parameters:
contentModel - The content model.

getOrderingType

public ComplexDataType getOrderingType()
Returns the ordering type. The ordering type allows the order of this types elements to be defined at runtime. When a complex object is created and associated with the hierarchy tree, it will search for it's nearest earlier ancestor element whose type is equal to its complex types ordering type. It will then use the ordering objects element order to order its local elements.

Returns:
The ordering type.

setOrderingType

public void setOrderingType(ComplexDataType orderingType)
Sets the ordering type.

Parameters:
orderingType - The ordering type.

isCollated

public boolean isCollated()
Returns whether this type is collated. Marking a complex type as collated is a hint to client code that objects of the type are eligible to be considered as a single value and do not always need to be broken into smaller parts to be useful. Examples of this are postal / zip codes, BIC codes and ISIN codes.

Returns:
Whether the type is collated.

setCollated

public void setCollated(boolean collated)
Sets whether this field would like its subfields collated.

Parameters:
collated - Whether to collate subfields.

isAttributeGroup

public boolean isAttributeGroup()
Returns whether this type is an attribute group.

Returns:
Whether this type is an attribute group.

setAttributeGroup

public void setAttributeGroup(boolean attributeGroup)
Sets whether this type is an attribute group.

Parameters:
attributeGroup - The new value.

isElementGroup

public boolean isElementGroup()
Returns whether this type is an element group.

Returns:
Whether this type is an element group.

setElementGroup

public void setElementGroup(boolean elementGroup)
Sets whether this type is an element group.

Parameters:
elementGroup - The new value.

isAbstract

public boolean isAbstract()
Returns whether this type is abstract. Abstract types can not create objects directly, they must be derived and the object created from the derived type.

Returns:
Whether this type is abstract.

setAbstract

public void setAbstract(boolean abstracT)
Sets whether this type is abstract.

Parameters:
abstracT - The new value.

isMixed

public boolean isMixed()
Returns whether this type is mixed. Mixed types allow elements and textual content together.

Returns:
Whether this type is mixed.

setMixed

public void setMixed(boolean mixed)
Sets whether this type is mixed.

Parameters:
mixed - The new value.

getFormatType

public FormatTypeEnum getFormatType()
Returns the format type. A format type defines the process by which a type will be parsed.

Returns:
The format type.

setFormatType

public void setFormatType(FormatTypeEnum formatType)
Sets the format type.

Parameters:
formatType - The format type.

getDelimiter

public String[] getDelimiter()
Returns the delimiter(s). Any item in the returned array is considered a valid delimiter but the first item will always be used when formatting. The array returned by this method will never be of length 0, it will null if no delimiters have been specified.

Returns:
The delimiter(s), or null is none have been specified.

setDelimiter

public void setDelimiter(String[] delimiter)
Sets the delimiter(s).

Parameters:
delimiter - The delimiter(s).

getDelimiterLocation

public DelimiterLocationEnum getDelimiterLocation()
Returns the location of the delimiter. The delimiters location controls where the delimiters are placed with respect to the elements.

Returns:
The delimiter's location.

setDelimiterLocation

public void setDelimiterLocation(DelimiterLocationEnum delimiterLocation)
Sets the delimiter's location.

Parameters:
delimiterLocation - The delimiter's location.

isDelimiterPlaceholder

public boolean isDelimiterPlaceholder()
Returns whether the delimiter uses placeholders. Placeholders force a delimiter to appear even if an optional field is not present.

Returns:
Whether the delimiter uses placeholders .

setDelimiterPlaceholder

public void setDelimiterPlaceholder(boolean delimiterPlaceholder)
Sets the delimiter's status as a placeholder or not.

Parameters:
delimiterPlaceholder - The new value.

getDelimiterFieldWrapper

public String[] getDelimiterFieldWrapper()
Returns the delimiter field wrapper(s). Delimiter field wrappers provide a way of 'escaping' the delimiter character when it appears in an elements value. e.g. "A,B,'C,D',E" would parse into 4 elements if the delimiter field wrapper was set up as "'". Any item in the returned array is considered a valid delimiter wrapper but the first item will always be used when formatting. The array returned by this method will never be of length 0, it will null if no delimiter wrappers have been specified.

Returns:
The delimiter field wrappers

setDelimiterFieldWrapper

public void setDelimiterFieldWrapper(String[] delimiterFieldWrapper)
Sets the delimiter field wrapper(s).

Parameters:
delimiterFieldWrapper - The new value.

getContentType

public SimpleDataType getContentType()
Returns the content type.

Returns:
The content type.

setContentType

public void setContentType(SimpleDataType contentType)
Sets the content type.

Parameters:
contentType - The new content type.

isExcludeFromDatabase

public boolean isExcludeFromDatabase()
Returns whether this object should be excluded from database persistence.

Returns:
The boolean value.

setExcludeFromDatabase

public void setExcludeFromDatabase(boolean excludeFromDatabase)
Sets whether this object should be excluded from database persistence.

Parameters:
excludeFromDatabase - The new boolean value.

lookupExpectedElement

public Element lookupExpectedElement(InputStream stream,
                                     Element docRoot,
                                     ComplexDataType docRootType)
                              throws IOException
Expected element discovery callback.

Returns the expected element based on incoming data. Designed to aid the expected element if it is not specified on begin of parsing textual data. Provided stream is the incoming data stream. The default implementation is not markable. If this returns the null (by default) the expected element discovery is the source responsibility. To override this need to specify the document root discriminator property in model.

Parameters:
stream - The incoming data stream.
docRoot - The document root element instance.
docRootType - The type of the document root element instance.
Returns:
The expected element, or null (default implementation).
Throws:
IOException - If unexpected I/O error happend.

addElementDecl

public void addElementDecl(Element element)
Adds an element declaration.

Parameters:
element - The element.
Throws:
IllegalArgumentException - If an element declaration called name has already been added.

removeElementDecl

public void removeElementDecl(Element element)
Removes an element declaration.

Parameters:
element - The element to be removed.

removeElementDecl

public void removeElementDecl(int index)
Removes the element declaration at index i.

Parameters:
index - The index of the element declaration to be removed

getNativeElementDeclCount

public int getNativeElementDeclCount()
Returns the number of elements native to this type (i.e. not inherited from the base type).

Returns:
The number of native elements.

getNativeElementDecl

public Element getNativeElementDecl(int index)
Returns the native element at index.

Parameters:
index - The index of the element to return.
Returns:
The element.

getNativeElementDeclIndex

public int getNativeElementDeclIndex(Element element)
Returns the index of a native element declaration.

Parameters:
element - The element.
Returns:
The index.

getElementDeclCount

public int getElementDeclCount()
Returns the total number of elements present in this types structure. The returned figure will include native elements and any inherited from the base type.

Returns:
The element count.

getElementDecl

public Element getElementDecl(int index)
Returns the element declaration at index.

Parameters:
index - The index of the element to return.
Returns:
The element.

getElementDecl

public Element getElementDecl(String name)
Returns the element declaration called name.

Parameters:
name - The name of the element to return.
Returns:
The element.
Throws:
IllegalArgumentException - If the element could not be found.

containsElementDecl

public boolean containsElementDecl(String name)
Returns whether this type contains an element declaration called name
Parameters:
name - The name of the element.
Returns:
Whether an element called name is present.

getElementDeclIndex

public int getElementDeclIndex(Element element)
Returns the index of an element declaration.

Parameters:
element - The element.
Returns:
The index.

addAttrDecl

public void addAttrDecl(Attribute attr)
Adds a attribute declaration to the structure of this object.

Parameters:
attr - The attribute.

removeAttrDecl

public void removeAttrDecl(Attribute attr)
Removes the attribute declaration.

Parameters:
attr - The attribute declaration to be removed.

removeAttrDecl

public void removeAttrDecl(int index)
Removes the attribute declaration at index i.

Parameters:
index - The index of the attribute declaration to be removed

getNativeAttrDeclCount

public int getNativeAttrDeclCount()
Returns the number of native attributes (i.e. not inherited from the base type).

Returns:
The number of native attributes.

getNativeAttrDecl

public Attribute getNativeAttrDecl(int index)
Return the native attribute declaration at index.

Parameters:
index - The index.
Returns:
The attribute.

getNativeAttrDeclIndex

public int getNativeAttrDeclIndex(Attribute attr)
Returns the index of native attribute declaration.

Parameters:
attr - The attribute.
Returns:
The index.

getAttrDeclCount

public int getAttrDeclCount()
Returns the total number of attribute present in this types structure. The returned figure will include attributes inherited from the base type.

Returns:
The attribute count.

getAttrDecl

public Attribute getAttrDecl(int index)
Returns the attribute declaration at index.

Parameters:
index - The index.
Returns:
The attribute.

getAttrDecl

public Attribute getAttrDecl(String name)
Returns the attribute declaration called name.

Parameters:
name - The name of the attribute.
Returns:
The attribute.
Throws:
IllegalArgumentException - If the attribute could not be found.

containsAttrDecl

public boolean containsAttrDecl(String name)
Returns whether this type contains a attribute called name.

Parameters:
name - The name of the attribute.
Returns:
Whether the attribute is present.

getAttrDeclIndex

public int getAttrDeclIndex(Attribute attr)
Returns the index of attribute.

Parameters:
attr - The attribute.
Returns:
The index.

validateProperties

public boolean validateProperties(Object object,
                                  DataComponent comp,
                                  ComplexDataObject context,
                                  ValidationManager manager)
                           throws ValidationException
Overrides:
validateProperties in class DataType
Throws:
ValidationException

getIdGenerator

public IDGeneratorMethodEnum getIdGenerator()
returns the Hibernate Id generator method to be used.

Returns:
The ID Generator method

setIdGenerator

public void setIdGenerator(IDGeneratorMethodEnum idGenerator)
sets the Hibernate ID generation method to be used.

Parameters:
idGenerator - The Id Generator Method IDGeneratorMethodEnum

getChildSequenceColumnName

public String getChildSequenceColumnName()
Returns the name of the child, that represents the column in a database, that will be used to store the order of the children.

Returns:
theName

setChildSequenceColumnName

public void setChildSequenceColumnName(String childSequenceColumnName)
Sets the name of the child, that represents the column in a database, that will be used to store the order of the children.

Parameters:
childSequenceColumnName - then name of the child

getIdGeneratorParameters

public IDGeneratorParameter[] getIdGeneratorParameters()
Returns all the Id Generator parameters as an array of IDGeneratorParameter.

Returns:
the parameters

addIdGeneratorParameter

public void addIdGeneratorParameter(IDGeneratorParameter parameter)
Adds and IDGeneratorParameter to the list. These parameters will be passed to the ID Generator when using Hibernate.

Parameters:
parameter - The IDGeneratorParameter containing the name and value

getIdGeneratorParameterIndex

public int getIdGeneratorParameterIndex(IDGeneratorParameter parameter)
Returns the location of the specified IDGeneratorParameter, of where it will appear when applied to the Id Generator.

Parameters:
parameter - The parametmer to return the index of.
Returns:
The index of the Id Generator parameter

removeIdGeneratorParameter

public void removeIdGeneratorParameter(IDGeneratorParameter parameter)
Removes the specified parameter.

Parameters:
parameter - The IDGeneratorParameter to be removed

setIdGeneratorParameterAt

public void setIdGeneratorParameterAt(IDGeneratorParameter parameter,
                                      int index)
Sets the parameter at a specified index.

Parameters:
parameter - The new IDGeneratorParameter
index - the index

setUrType

public void setUrType(boolean urType)
Sets whether this is a UR-type.

Parameters:
urType - Whether this is a UR-type.

isUrType

public boolean isUrType()
Sets whether this type represents a UR-type.

Returns:
Whether this is a UR-type.

isProcessAsBatch

public final boolean isProcessAsBatch()
Gets whether this type should be processsed as a batch.

Returns:
whether this be processed as batch.

setProcessAsBatch

public void setProcessAsBatch(boolean processAsBatch)
Sets whether this type should be processed as a batch.

Parameters:
processAsBatch - Whether this should be processed as a batch.

getBitMap

public BitMap getBitMap()

setBitMap

public void setBitMap(BitMap bitMap)

getAlignToBorder

public AlignToBorder getAlignToBorder()

setAlignToBorder

public void setAlignToBorder(AlignToBorder alignToBorder)


C24 Technologies © 2002-2012: All Rights Reserved.