Top Description Methods
com.sun.msv.verifier.psvi

public Interface TypedContentHandler

Imports
org.relaxng.datatype.Datatype, .ValidationContext, org.xml.sax.SAXException, com.sun.msv.grammar.AttributeExp, .ElementExp

Receives notification of the typed content of the document.

This interface can be considered as the SAX ContentHandler plus type-information. It is intended to help applications to interpret the incoming document.

Consider a following RELAX NG pattern and instance:

<element name="root">
  <optional>
    <attribute name="foo">
      <choice>
        <data type="boolean"/>
        <data type="date"/>
      </choice>
    </attribute>
  </optional>
  <element name="child">
    <list><zeroOrMore>
      <data type="NMTOKEN"/>
    </zeroOrMore></list>
  </element>
</element>

<root foo="true">
  <child> A B </child>
</root>
Events are reported in the following order:
startDocument()
 startElement(root)
  startAttribute(foo)
   characterChunk("true", com.sun.msv.datatype.xsd.BooleanType)
  endAttribute(foo)
  endAttributePart()
  startElement(child)
   characterChunk("A", com.sun.msv.datatype.xsd.NMTOKENType)
   characterChunk("B", com.sun.msv.datatype.xsd.NMTOKENType)
  endElement(child, MSV's internal object that represents the child element)
 endElement(root, MSV's internal object that represents the root element)
endDocument()
Author
Kohsuke KAWAGUCHI
See Also
TypeDetector

Method Summary

Modifier and TypeMethod and Description
public void
characterChunk(String
the contents.
literal
,
Datatype
assigned type. The validator assigns this type for this literal.
type
)

receives notification of a string.

public void
endAttribute(String namespaceURI, String localName, String qName, AttributeExp
assigned type.
type
)

receives notification of the end of an attribute.

public void
endAttributePart()

this method is called after the start/endAttribute method are called for all attributes.

public void
endDocument()

receives notification of the end of a document.

public void
endElement(String namespaceURI, String localName, String qName, ElementExp
the type of this element.
type
)

receives notification of the end of an element.

public void
startAttribute(String namespaceURI, String localName, String qName)

receives notification of the start of an attribute.

public void
startDocument(ValidationContext
This ValidationContext object is effective through the entire document.
context
)

receives notification of the start of a document.

public void
startElement(String namespaceURI, String localName, String qName)

receives notification of the start of an element.

Method Detail

characterChunkback to summary
public void characterChunk(String literal, Datatype type) throws SAXException

receives notification of a string.

Parameters
literal:String

the contents.

type:Datatype

assigned type. The validator assigns this type for this literal.

endAttributeback to summary
public void endAttribute(String namespaceURI, String localName, String qName, AttributeExp type) throws SAXException

receives notification of the end of an attribute.

Parameters
type:AttributeExp

assigned type.

endAttributePartback to summary
public void endAttributePart() throws SAXException

this method is called after the start/endAttribute method are called for all attributes.

endDocumentback to summary
public void endDocument() throws SAXException

receives notification of the end of a document.

endElementback to summary
public void endElement(String namespaceURI, String localName, String qName, ElementExp type) throws SAXException

receives notification of the end of an element.

Parameters
type:ElementExp

the type of this element.

startAttributeback to summary
public void startAttribute(String namespaceURI, String localName, String qName) throws SAXException

receives notification of the start of an attribute. the value of the attribute is reported through the characterChunk method.

startDocumentback to summary
public void startDocument(ValidationContext context) throws SAXException

receives notification of the start of a document.

Parameters
context:ValidationContext

This ValidationContext object is effective through the entire document.

startElementback to summary
public void startElement(String namespaceURI, String localName, String qName) throws SAXException

receives notification of the start of an element. If this element has attributes, the start/endAttribute methods are called after this method.