Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.msv.verifier.psvi
Interface TypedContentHandler

public interface TypedContentHandler

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
`void` | `characterChunk(java.lang.String literal, Datatype type)` receives notification of a string.
`void` | `endAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, AttributeExp type)` receives notification of the end of an attribute.
`void` | `endAttributePart()` this method is called after the start/endAttribute method are called for all attributes.
`void` | `endDocument()` receives notification of the end of a document.
`void` | `endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, ElementExp type)` receives notification of the end of an element.
`void` | `startAttribute(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)` receives notification of the start of an attribute.
`void` | `startDocument(ValidationContext context)` receives notification of the start of a document.
`void` | `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)` receives notification of the start of an element.

Method Detail

### startDocument

    public void startDocument(ValidationContext context)
                       throws org.xml.sax.SAXException

  receives notification of the start of a document.

  Parameters:
    `context` - This ValidationContext object is effective through the entire document.
  Throws:
    `org.xml.sax.SAXException`

### endDocument

    public void endDocument()
                     throws org.xml.sax.SAXException

  receives notification of the end of a document.

  Throws:
    `org.xml.sax.SAXException`

### characterChunk

    public void characterChunk(java.lang.String literal,
                               Datatype type)
                        throws org.xml.sax.SAXException

  receives notification of a string.

  Parameters:
    `literal` - the contents.
    `type` - assigned type. The validator assigns this type for this literal.
  Throws:
    `org.xml.sax.SAXException`

### startElement

    public void startElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String qName)
                      throws org.xml.sax.SAXException

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

  Throws:
    `org.xml.sax.SAXException`

### endElement

    public void endElement(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String qName,
                           ElementExp type)
                    throws org.xml.sax.SAXException

  receives notification of the end of an element.

  Parameters:
    `type` - the type of this element.
  Throws:
    `org.xml.sax.SAXException`

### startAttribute

    public void startAttribute(java.lang.String namespaceURI,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException

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

  Throws:
    `org.xml.sax.SAXException`

### endAttribute

    public void endAttribute(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String qName,
                             AttributeExp type)
                      throws org.xml.sax.SAXException

  receives notification of the end of an attribute.

  Parameters:
    `type` - assigned type.
  Throws:
    `org.xml.sax.SAXException`

### endAttributePart

    public void endAttributePart()
                          throws org.xml.sax.SAXException

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

  Throws:
    `org.xml.sax.SAXException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD