org.jbind.xml.core.data
Interface IAnyTypeData

All Known Subinterfaces:
IAnyListTypeData, IAnySimpleTypeData, IAnyURIData, IApplication, IBase64BinaryData, IBooleanData, IByteData, IComplexCCData, IComplexData, IComplexSCData, IConfiguration, IDateData, IDateTimeData, IDecimalData, IDoubleData, IDurationData, IENTITIESData, IENTITYData, IFloatData, IGDayData, IGMonthData, IGMonthDayData, IGYearData, IGYearMonthData, IHexBinaryData, IIDData, IIDREFData, IIDREFSData, IIntData, IIntegerData, ILanguageData, ILongData, INameData, INCNameData, INegativeIntegerData, INMTOKENData, INMTOKENSData, INonNegativeIntegerData, INonPositiveIntegerData, INormalizedStringData, INOTATIONData, IPositiveIntegerData, IQNameData, IShortData, ISimpleData, ISpaceData, IStringData, ITimeData, ITokenData, IUnsignedByteData, IUnsignedIntData, IUnsignedLongData, IUnsignedShortData
All Known Implementing Classes:
AbstractData, AbstractDecimalData, AbstractIntData, AbstractIntegerData, AbstractLongData, AbstractShortData, AbstractSimpleData, AbstractUnsignedIntData, AbstractUnsignedShortData, AnyListTypeData, AnySimpleTypeData, AnyTypeData, AnyURIData, Base64BinaryData, BooleanData, ByteData, DateData, DateTimeData, DoubleData, DurationData, ENTITIESData, ENTITYData, FloatData, GDayData, GMonthData, GMonthDayData, GYearData, GYearMonthData, HexBinaryData, IDData, IDREFData, IDREFSData, LanguageData, NameData, NCNameData, NegativeIntegerData, NMTOKENData, NMTOKENSData, NonNegativeIntegerData, NonPositiveIntegerData, NormalizedStringData, NOTATIONData, PositiveIntegerData, QNameData, SpaceData, StringData, TimeData, TokenData, UnsignedByteData, UnsignedLongData

public interface IAnyTypeData

Base for all data objects. Data objects are wrapper classes for simple storage values and are backed by data implementations that store their complex content and attributes (if applicable).


Method Summary
 void accept_(IDataVisitor aVisitor)
          Accepts a data visitor.
 void acceptImpl_()
          Accepts the current data implementation by creating a corresponding value for internal storage.
 void addReferencedData_(java.lang.String aKey, IAnyTypeData aData)
          Adds a data object that is referenced by this data object.
 IAnyTypeData createElement_(IElemRefOrDecl anElemRefOrDecl, IAnyType anOverloadingType, java.lang.String aTextContent)
          Generice method for creating an element.
 IAnyTypeData createElement_(java.lang.String aNamespace, java.lang.String aName, IAnyType anOverloadingType, java.lang.String aSimpleContent)
          Generice method for creating an element.
 boolean equals(java.lang.Object anObject)
          Checks either reference equality or value equality depending on the type of the data.
 IAnyTypeData getAttribute_(java.lang.String aNamespace, java.lang.String aName)
          Generic method for getting an attribute.
 IDataDesc getDataDesc_()
          Gets the description of the data.
 IDataImpl getImpl_()
          Gets the data implementation of the data object.
 IComplexData getParent_()
          Gets the parent data object.
 IElemRefOrDecl getSubstitutionHead_()
          Gets the element declaration of the substition head.
 IAnyType getType_()
          Gets the type of the data object.
 int hashCode()
          Calculates the hash code.
 boolean isDefault_()
          Checks if the data has a default value or if it has an explicitly assigned value.
 boolean isNil_()
          Indicates that the data is nil.
 java.util.Iterator iterAttributes_(java.lang.String aNamespace, java.lang.String aName)
          Generic method for iterating attributes.
 java.util.ListIterator iterElements_(java.lang.String aNamespace, java.lang.String aName)
          Generic method for iterating elements.
 IAnyTypeData setAttribute_(java.lang.String aNamespace, java.lang.String aName, IAnyType anOverloadingType, java.lang.String aTextContent)
          Generic method for setting an attribute.
 void setDataDesc_(IDataDesc aDataDesc)
          Sets the data description.
 void setImpl_(IDataImpl anImpl)
          Sets the implementation of the data object.
 void setSubstitutionHead_(IElemRefOrDecl aHead)
          Sets the substitution head.
 void setType_(IAnyType aType)
          Set the type of the data object.
 

Method Detail

getType_

public IAnyType getType_()
Gets the type of the data object.

Returns:
(required).

getImpl_

public IDataImpl getImpl_()
Gets the data implementation of the data object.

Returns:
(required).

acceptImpl_

public void acceptImpl_()
                 throws XmlException
Accepts the current data implementation by creating a corresponding value for internal storage. The created value is called the simple storage value. It can either have a primitive type or a (simple) reference type. An exception is raised if the simple storage value could not be created.

Only the constraints that are inherent in the creation of the simple storage value are checked. Any further constraints of the type of the data object that constrain the possible values are not checked.

This method treats only the textual content of the data implementation getTextContent. Attributes and elements are not considered.

Throws:
XmlException - Raised iff the simple storage value could not be created.

setType_

public void setType_(IAnyType aType)
Set the type of the data object.

Parameters:
aType - (required).

setImpl_

public void setImpl_(IDataImpl anImpl)
              throws XmlException
Sets the implementation of the data object.

Parameters:
anImpl - (required).
Throws:
XmlException

isDefault_

public boolean isDefault_()
Checks if the data has a default value or if it has an explicitly assigned value.

Returns:
Returns true iff the data has a default value.

isNil_

public boolean isNil_()
Indicates that the data is nil.

Returns:
Returns true iff the data is nil.

accept_

public void accept_(IDataVisitor aVisitor)
Accepts a data visitor.

Parameters:
aVisitor - (required).

addReferencedData_

public void addReferencedData_(java.lang.String aKey,
                               IAnyTypeData aData)
Adds a data object that is referenced by this data object.

Parameters:
aKey - (required). Identifies the reference constraint that referenced the data object.
aData - (required). The referenced data.

getDataDesc_

public IDataDesc getDataDesc_()
Gets the description of the data. All data objects that where created as instances of elements or attributes have a data description. The only data objects that do not have a data description are data objects that appear in a schema as default or fixed values or in facets.

Returns:
(optional). The data description that was used to create this data object.

setDataDesc_

public void setDataDesc_(IDataDesc aDataDesc)
Sets the data description.

Parameters:
aDataDesc - (required).

getSubstitutionHead_

public IElemRefOrDecl getSubstitutionHead_()
Gets the element declaration of the substition head. The data object has a substitution head iff it is an instance of an element that is a substitute. In this case the element declaration that allowed this element as a substitute is returned.

Returns:
(optional).

setSubstitutionHead_

public void setSubstitutionHead_(IElemRefOrDecl aHead)
Sets the substitution head.

Parameters:
aHead - (required).

equals

public boolean equals(java.lang.Object anObject)
Checks either reference equality or value equality depending on the type of the data. For complex data objects reference equality is checked whereas for non-complex data objects value equality is checked. Complex data objects with simple content are considered as complex data, i.e. reference equality is checked.

Parameters:
anObject - (optional).
Returns:
Returns true iff the specified object is of the same type or of a sub type as this data and has the same value as this data.

hashCode

public int hashCode()
Calculates the hash code. The hash code is either based on the object identity or on the value depending on the type of the data. Complex data objects (with simple or complex content) use the Object.hashCode() method whereas non-complex data objects calculate a value based hash code.

Returns:
A hash code that is either based on the data object identity or on the data value.

createElement_

public IAnyTypeData createElement_(java.lang.String aNamespace,
                                   java.lang.String aName,
                                   IAnyType anOverloadingType,
                                   java.lang.String aSimpleContent)
                            throws XmlException
Generice method for creating an element. The created element is appended to the content. This method can be used to create elements that are declared by an element wildcard or that belong to the substitution group of an element. It is checked that the element to be created is allowed in the content model of the data object. Yet, the order of elements is not checked.

Parameters:
aNamespace - (required).
aName - (required).
anOverloadingType - (optional). If no overloading type is specified then the declared element type is used. If the element to be created corresponds to an element wildcard then the anyType is used.
aSimpleContent - (optional). If the element type has a simple content model then the simple content parameter is required.
Returns:
(required).
Throws:
XmlException - Raised iff the element could not be created. Indicates that the element to be created is not allowed in the content model.

createElement_

public IAnyTypeData createElement_(IElemRefOrDecl anElemRefOrDecl,
                                   IAnyType anOverloadingType,
                                   java.lang.String aTextContent)
                            throws XmlException
Generice method for creating an element. The created element is appended to the content. It is not checked if the supplied element reference or declaration is allowed in the content model of this data object.

Parameters:
anOverloadingType - (optional). If no overloading type is specified then the declared element type is used. If the element to be created corresponds to an element wildcard then the anyType is used.
Returns:
(required).
Throws:
XmlException - Raised iff the element could not be created.

iterElements_

public java.util.ListIterator iterElements_(java.lang.String aNamespace,
                                            java.lang.String aName)
Generic method for iterating elements. This method can be used to access elements that are declared by an element wildcard.

Parameters:
aNamespace - (optional). If no namespace is specified then elements of all namespaces are considered.
aName - (optional). If no name is specified then elements with arbitrary names are considered.
Returns:
(required). An iterator of IAnyTypeData objects corresponding to the specified namespace and name.

setAttribute_

public IAnyTypeData setAttribute_(java.lang.String aNamespace,
                                  java.lang.String aName,
                                  IAnyType anOverloadingType,
                                  java.lang.String aTextContent)
                           throws XmlException
Generic method for setting an attribute. This method can be used to set attributes that are declared by an attribute wildcard.

Parameters:
aNamespace - (required).
aName - (required).
anOverloadingType - (optional). If no overloading type is specified then the declared attribute type is used. If the attribute to be set corresponds to an attribute wildcard then the anySimpleType is used.
aTextContent - (required).
Throws:
XmlException - Raised iff the attribute could not be set.

iterAttributes_

public java.util.Iterator iterAttributes_(java.lang.String aNamespace,
                                          java.lang.String aName)
Generic method for iterating attributes. This method can be used to access attributes that are declared by an attribute wildcard.

Parameters:
aNamespace - (optional). If no namespace is specified then attributes of all namespaces are returned.
aName - (optional). If no name is specified then attributes with arbitrary names are returned.
Returns:
(required). An iterator of IAnyTypeData objects corresponding to the specified namespace and name.

getAttribute_

public IAnyTypeData getAttribute_(java.lang.String aNamespace,
                                  java.lang.String aName)
Generic method for getting an attribute. This method can be used to access attributes that are declared by an attribute wildcard.

Parameters:
aNamespace - (required).
aName - (required).
Returns:
(optional).

getParent_

public IComplexData getParent_()
Gets the parent data object. If this data object is an attribute then the element data that owns this attribute is returned.

Returns:
(optional) The enclosing or owning element.