org.modeshape.sequencer.xml

## Class XmlSequencerHandler

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.xml.sax.ext.DefaultHandler2
    - - org.modeshape.sequencer.xml.XmlSequencerHandler

- All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler, EntityResolver2, LexicalHandler

      public class XmlSequencerHandler
      extends DefaultHandler2

  A `DefaultHandler2` implementation that is used by the sequencer.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TextDecoder` | `decoder` The TextDecoder that is used to decode the names.
    `static XmlSequencer.AttributeScoping` | `DEFAULT_ATTRIBUTE_SCOPING` The default `XmlSequencer.AttributeScoping`.
    `static TextDecoder` | `DEFAULT_DECODER` Decoder for XML names, to turn '_xHHHH_' sequences in the XML element and attribute names into the corresponding UTF-16 characters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] ch, int start, int length)`
    `void` | `comment(char[] ch, int start, int length)`
    `void` | `endCDATA()`
    `protected void` | `endContent()` See if there is any element content that needs to be completed.
    `void` | `endElement(String uri, String localName, String name)`
    `void` | `endEntity(String name)`
    `void` | `endPrefixMapping(String prefix)`
    `void` | `error(SAXParseException error)`
    `void` | `externalEntityDecl(String name, String publicId, String systemId)`
    `void` | `internalEntityDecl(String name, String value)`
    `void` | `processingInstruction(String target, String data)`
    `void` | `startCDATA()`
    `void` | `startDocument()`
    `void` | `startDTD(String name, String publicId, String systemId)`
    `void` | `startElement(String uri, String localName, String name, Attributes attributes)`
    `void` | `startEntity(String name)`
    `void` | `startPrefixMapping(String prefix, String uri)` This method ensures that the namespace is registered with the `registry`, using the supplied prefix to register the namespace if required.
    `void` | `warning(SAXParseException warning)`

    - ### Methods inherited from class org.xml.sax.ext.DefaultHandler2

      `attributeDecl, elementDecl, endDTD, getExternalSubset, resolveEntity, resolveEntity`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `endDocument, fatalError, ignorableWhitespace, notationDecl, setDocumentLocator, skippedEntity, unparsedEntityDecl`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_DECODER

          public static TextDecoder DEFAULT_DECODER

      Decoder for XML names, to turn '_xHHHH_' sequences in the XML element and attribute names into the corresponding UTF-16 characters.

    - #### DEFAULT_ATTRIBUTE_SCOPING

          public static XmlSequencer.AttributeScoping DEFAULT_ATTRIBUTE_SCOPING

      The default `XmlSequencer.AttributeScoping`.

    - #### decoder

          protected final TextDecoder decoder

      The TextDecoder that is used to decode the names.

  - ### Method Detail

    - #### endContent

          protected void endContent()
                             throws RepositoryException

      See if there is any element content that needs to be completed.
      Throws:
        `RepositoryException` - if there is a problem writing the content to the repository session

    - #### startDocument

          public void startDocument()
                             throws SAXException

      Specified by:
        `startDocument` in interface `ContentHandler`
      Overrides:
        `startDocument` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### startDTD

          public void startDTD(String name,
                      String publicId,
                      String systemId)
                        throws SAXException

      Specified by:
        `startDTD` in interface `LexicalHandler`
      Overrides:
        `startDTD` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### externalEntityDecl

          public void externalEntityDecl(String name,
                                String publicId,
                                String systemId)
                                  throws SAXException

      Specified by:
        `externalEntityDecl` in interface `DeclHandler`
      Overrides:
        `externalEntityDecl` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### internalEntityDecl

          public void internalEntityDecl(String name,
                                String value)
                                  throws SAXException

      Specified by:
        `internalEntityDecl` in interface `DeclHandler`
      Overrides:
        `internalEntityDecl` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### processingInstruction

          public void processingInstruction(String target,
                                   String data)
                                     throws SAXException

      Specified by:
        `processingInstruction` in interface `ContentHandler`
      Overrides:
        `processingInstruction` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### startPrefixMapping

          public void startPrefixMapping(String prefix,
                                String uri)
                                  throws SAXException

      This method ensures that the namespace is registered with the `registry`, using the supplied prefix to register the namespace if required. Note that because this class does not really use the namespace prefixes to create names, no attempt is made to match the XML namespace prefixes.

      Specified by:
        `startPrefixMapping` in interface `ContentHandler`
      Overrides:
        `startPrefixMapping` in class `DefaultHandler`
      Throws:
        `SAXException`
      See Also:
        `DefaultHandler.startPrefixMapping(String, String)`

    - #### endPrefixMapping

          public void endPrefixMapping(String prefix)
                                throws SAXException

      Specified by:
        `endPrefixMapping` in interface `ContentHandler`
      Overrides:
        `endPrefixMapping` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### startEntity

          public void startEntity(String name)

      Specified by:
        `startEntity` in interface `LexicalHandler`
      Overrides:
        `startEntity` in class `DefaultHandler2`

    - #### endEntity

          public void endEntity(String name)

      Specified by:
        `endEntity` in interface `LexicalHandler`
      Overrides:
        `endEntity` in class `DefaultHandler2`

    - #### startCDATA

          public void startCDATA()
                          throws SAXException

      Specified by:
        `startCDATA` in interface `LexicalHandler`
      Overrides:
        `startCDATA` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### endCDATA

          public void endCDATA()
                        throws SAXException

      Specified by:
        `endCDATA` in interface `LexicalHandler`
      Overrides:
        `endCDATA` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### characters

          public void characters(char[] ch,
                        int start,
                        int length)

      Specified by:
        `characters` in interface `ContentHandler`
      Overrides:
        `characters` in class `DefaultHandler`

    - #### comment

          public void comment(char[] ch,
                     int start,
                     int length)
                       throws SAXException

      Specified by:
        `comment` in interface `LexicalHandler`
      Overrides:
        `comment` in class `DefaultHandler2`
      Throws:
        `SAXException`

    - #### startElement

          public void startElement(String uri,
                          String localName,
                          String name,
                          Attributes attributes)
                            throws SAXException

      Specified by:
        `startElement` in interface `ContentHandler`
      Overrides:
        `startElement` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### endElement

          public void endElement(String uri,
                        String localName,
                        String name)
                          throws SAXException

      Specified by:
        `endElement` in interface `ContentHandler`
      Overrides:
        `endElement` in class `DefaultHandler`
      Throws:
        `SAXException`

    - #### warning

          public void warning(SAXParseException warning)

      Specified by:
        `warning` in interface `ErrorHandler`
      Overrides:
        `warning` in class `DefaultHandler`

    - #### error

          public void error(SAXParseException error)

      Specified by:
        `error` in interface `ErrorHandler`
      Overrides:
        `error` in class `DefaultHandler`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.