Class DatatypeElement

All Implemented Interfaces:
com.sun.msv.datatype.SerializationContext, Serializable, Cloneable, Branch, Element, Node, org.relaxng.datatype.ValidationContext

public class DatatypeElement extends DefaultElement implements com.sun.msv.datatype.SerializationContext, org.relaxng.datatype.ValidationContext

DatatypeElement represents an Element which supports the XML Schema Data Types specification.

Version:
$Revision: 1.9 $
See Also:
  • Field Details

    • datatype

      private com.sun.msv.datatype.xsd.XSDatatype datatype
      The XSDatatype of the Attribute
    • data

      private Object data
      The data (Object) value of the Attribute
  • Constructor Details

    • DatatypeElement

      public DatatypeElement(QName qname, com.sun.msv.datatype.xsd.XSDatatype datatype)
    • DatatypeElement

      public DatatypeElement(QName qname, int attributeCount, com.sun.msv.datatype.xsd.XSDatatype type)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class AbstractElement
    • getXSDatatype

      public com.sun.msv.datatype.xsd.XSDatatype getXSDatatype()
      Returns the MSV XSDatatype for this node
      Returns:
      DOCUMENT ME!
    • getNamespacePrefix

      public String getNamespacePrefix(String uri)
      Specified by:
      getNamespacePrefix in interface com.sun.msv.datatype.SerializationContext
    • getBaseUri

      public String getBaseUri()
      Specified by:
      getBaseUri in interface org.relaxng.datatype.ValidationContext
    • isNotation

      public boolean isNotation(String notationName)
      Specified by:
      isNotation in interface org.relaxng.datatype.ValidationContext
    • isUnparsedEntity

      public boolean isUnparsedEntity(String entityName)
      Specified by:
      isUnparsedEntity in interface org.relaxng.datatype.ValidationContext
    • resolveNamespacePrefix

      public String resolveNamespacePrefix(String prefix)
      Specified by:
      resolveNamespacePrefix in interface org.relaxng.datatype.ValidationContext
    • getData

      public Object getData()
      Description copied from interface: Element
      Accesses the data of this element which may implement data typing bindings such as XML Schema or Java Bean bindings or will return the same value as Element.getText()
      Specified by:
      getData in interface Element
      Overrides:
      getData in class AbstractElement
      Returns:
      DOCUMENT ME!
    • setData

      public void setData(Object data)
      Description copied from interface: Element
      Sets the data value of this element if this element supports data binding or calls Node.setText(java.lang.String)if it doesn't
      Specified by:
      setData in interface Element
      Overrides:
      setData in class AbstractElement
      Parameters:
      data - DOCUMENT ME!
    • addText

      public Element addText(String text)
      Description copied from interface: Element
      Adds a new Text node with the given text to this element.
      Specified by:
      addText in interface Element
      Overrides:
      addText in class AbstractElement
      Parameters:
      text - is the text for the Text node.
      Returns:
      this Element instance.
    • setText

      public void setText(String text)
      Description copied from interface: Node

      Sets the text data of this node or this method will throw an UnsupportedOperationException if it is read-only.

      Specified by:
      setText in interface Node
      Overrides:
      setText in class AbstractElement
      Parameters:
      text - is the new textual value of this node
    • childAdded

      protected void childAdded(Node node)
      Override to force lazy recreation of data object
      Overrides:
      childAdded in class AbstractElement
      Parameters:
      node - DOCUMENT ME!
    • childRemoved

      protected void childRemoved(Node node)
      Override to force lazy recreation of data object
      Overrides:
      childRemoved in class AbstractElement
      Parameters:
      node - DOCUMENT ME!
    • validate

      protected void validate(String text) throws IllegalArgumentException
      Throws:
      IllegalArgumentException