org.jbind.xml.instance.data
Class AbstractSimpleData

java.lang.Object
  extended byorg.jbind.xml.instance.data.AbstractData
      extended byorg.jbind.xml.instance.data.AbstractSimpleData
All Implemented Interfaces:
IAnySimpleTypeData, IAnyTypeData, ISimpleData, ITextContentProvider
Direct Known Subclasses:
AbstractDateOrTimeData, AbstractDecimalData, AnyListTypeData, AnySimpleTypeData, AnyURIData, Base64BinaryData, BooleanData, DoubleData, FloatData, HexBinaryData, LanguageData, NOTATIONData, QNameData, StringData

public abstract class AbstractSimpleData
extends AbstractData
implements IAnySimpleTypeData


Constructor Summary
AbstractSimpleData()
           
 
Method Summary
 void acceptImpl_()
          Accepts the current data implementation by creating a corresponding value for internal storage.
protected  IConstraintViolations completeSimpleStorageAssignment_()
           
protected  void doAccept(java.lang.String aNormalizedValue)
          Hook method that accepts the normalized value and converts it into a corresponging internal representation (the so called simple storage object).
protected  void doAcceptEnds_(IDataVisitor aVisitor)
           
protected  void doAcceptStarts_(IDataVisitor aVisitor)
           
 java.lang.String getLexicalValue_()
          Gets the lexical value.
 java.lang.String getNormalizedValue_()
          Gets the normalized value.
 java.lang.Object getObject()
          Gets the simple storage object.
 java.lang.String getTextContent_()
           
 void setLexicalValue_(java.lang.String aValue)
          Sets the lexical value.
 void setObject(java.lang.Object aNewValue)
          Sets the simple storage object;
protected abstract  void setSimpleStorageObject(java.lang.Object anObject)
           
 java.lang.String toString()
          Return the lexical value.
 
Methods inherited from class org.jbind.xml.instance.data.AbstractData
accept_, addReferencedData_, createElement_, createElement_, createUncheckedAttributeData_, equals, fetchByXPath_, getAttribute_, getDataDesc_, getFixed_, getImpl_, getParent_, getSubstitutionHead_, getType_, hashCode, isDefault_, isNil_, iterAttributes_, iterElements_, iterReferencedData_, newElementData_, numberByXPath_, removeAttributeData_, selectByXPath_, setAttribute_, setDataDesc_, setImpl_, setSubstitutionHead_, setType_, stringByXPath_, testByXPath_
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.core.data.IAnyTypeData
accept_, addReferencedData_, createElement_, createElement_, equals, getAttribute_, getDataDesc_, getImpl_, getParent_, getSubstitutionHead_, getType_, hashCode, isDefault_, isNil_, iterAttributes_, iterElements_, setAttribute_, setDataDesc_, setImpl_, setSubstitutionHead_, setType_
 
Methods inherited from interface org.jbind.xml.core.data.ISimpleData
getCanonicalForm_, getSimpleStorageObject, simpleStorageValueEquals, simpleStorageValueHashCode
 

Constructor Detail

AbstractSimpleData

public AbstractSimpleData()
Method Detail

getLexicalValue_

public final java.lang.String getLexicalValue_()
Description copied from interface: ISimpleData
Gets the lexical value. The lexical value is the original string before any processing took place.

Specified by:
getLexicalValue_ in interface ISimpleData

getNormalizedValue_

public final java.lang.String getNormalizedValue_()
Description copied from interface: ISimpleData
Gets the normalized value. The normalized value results from transforming the lexical value according to the white space processing of the type of the data object.

Specified by:
getNormalizedValue_ in interface ISimpleData

toString

public final java.lang.String toString()
Description copied from interface: IAnySimpleTypeData
Return the lexical value.

Specified by:
toString in interface IAnySimpleTypeData

setLexicalValue_

public final void setLexicalValue_(java.lang.String aValue)
                            throws XmlException
Description copied from interface: ISimpleData
Sets the lexical value.

Specified by:
setLexicalValue_ in interface ISimpleData
Parameters:
aValue - (required).
Throws:
XmlException

acceptImpl_

public final void acceptImpl_()
                       throws XmlException
Description copied from interface: IAnyTypeData
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.

Specified by:
acceptImpl_ in interface IAnyTypeData
Throws:
XmlException - Raised iff the simple storage value could not be created.

doAccept

protected void doAccept(java.lang.String aNormalizedValue)
                 throws XmlException
Hook method that accepts the normalized value and converts it into a corresponging internal representation (the so called simple storage object).

If an exception is raised during execution of the method then this data object may be inconsistent. It is in the responsibility of the caller either to rollback the changes or to discard this data object.

Parameters:
aNormalizedValue - (required).
Throws:
XmlException - Raised iff the string can not be converted into the internal representation.

setSimpleStorageObject

protected abstract void setSimpleStorageObject(java.lang.Object anObject)

completeSimpleStorageAssignment_

protected final IConstraintViolations completeSimpleStorageAssignment_()

getTextContent_

public java.lang.String getTextContent_()
Specified by:
getTextContent_ in interface ITextContentProvider

getObject

public final java.lang.Object getObject()
Description copied from interface: IAnySimpleTypeData
Gets the simple storage object.

Specified by:
getObject in interface IAnySimpleTypeData
Returns:
(required).

setObject

public final void setObject(java.lang.Object aNewValue)
                     throws XmlException
Description copied from interface: IAnySimpleTypeData
Sets the simple storage object;

Specified by:
setObject in interface IAnySimpleTypeData
Parameters:
aNewValue - (required).
Throws:
XmlException

doAcceptStarts_

protected void doAcceptStarts_(IDataVisitor aVisitor)
Specified by:
doAcceptStarts_ in class AbstractData

doAcceptEnds_

protected void doAcceptEnds_(IDataVisitor aVisitor)
Specified by:
doAcceptEnds_ in class AbstractData