org.modeshape.sequencer.xml
Class XmlSequencerHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.xml.sax.ext.DefaultHandler2
          extended by 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
protected  Path currentPath
          The path for the node representing the current element.
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.
protected  Name defaultPrimaryType
          The default primary type.
protected  Name nameAttribute
          The name of the attribute that should be used for the node name.
protected  NameFactory nameFactory
          The cached reference to the graph's name factory.
protected  NamespaceRegistry namespaceRegistry
          The cached reference to the graph's namespace registry.
protected  PathFactory pathFactory
          The cached reference to the graph's path factory.
protected  PropertyFactory propertyFactory
          The cached reference to the graph's property factory.
 
Method Summary
 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 fatalError(SAXParseException error)
          
 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, 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.


nameAttribute

protected final Name nameAttribute
The name of the attribute that should be used for the node name.


defaultPrimaryType

protected final Name defaultPrimaryType
The default primary type.


pathFactory

protected final PathFactory pathFactory
The cached reference to the graph's path factory.


nameFactory

protected final NameFactory nameFactory
The cached reference to the graph's name factory.


propertyFactory

protected final PropertyFactory propertyFactory
The cached reference to the graph's property factory.


namespaceRegistry

protected final NamespaceRegistry namespaceRegistry
The cached reference to the graph's namespace registry.


decoder

protected final TextDecoder decoder
The TextDecoder that is used to decode the names.


currentPath

protected Path currentPath
The path for the node representing the current element. This starts out as the path supplied by the constructor, and never is shorter than that initial path.

Method Detail

endContent

protected void endContent()
See if there is any element content that needs to be completed.


startDocument

public void startDocument()

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
See Also:
DefaultHandler.startDocument()

startDTD

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

Specified by:
startDTD in interface LexicalHandler
Overrides:
startDTD in class DefaultHandler2
See Also:
DefaultHandler2.startDTD(java.lang.String, java.lang.String, java.lang.String)

externalEntityDecl

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

Specified by:
externalEntityDecl in interface DeclHandler
Overrides:
externalEntityDecl in class DefaultHandler2
See Also:
DefaultHandler2.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

internalEntityDecl

public void internalEntityDecl(String name,
                               String value)

Specified by:
internalEntityDecl in interface DeclHandler
Overrides:
internalEntityDecl in class DefaultHandler2
See Also:
DefaultHandler2.internalEntityDecl(java.lang.String, java.lang.String)

processingInstruction

public void processingInstruction(String target,
                                  String data)

Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class DefaultHandler
See Also:
DefaultHandler.processingInstruction(java.lang.String, java.lang.String)

startPrefixMapping

public 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. Note that because this class does not really use the namespace prefixes to create Name objects, no attempt is made to match the XML namespace prefixes.

Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class DefaultHandler
See Also:
DefaultHandler.startPrefixMapping(java.lang.String, java.lang.String)

endPrefixMapping

public void endPrefixMapping(String prefix)

Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class DefaultHandler
See Also:
DefaultHandler.endPrefixMapping(java.lang.String)

startEntity

public void startEntity(String name)

Specified by:
startEntity in interface LexicalHandler
Overrides:
startEntity in class DefaultHandler2
See Also:
DefaultHandler2.startEntity(java.lang.String)

endEntity

public void endEntity(String name)

Specified by:
endEntity in interface LexicalHandler
Overrides:
endEntity in class DefaultHandler2
See Also:
DefaultHandler2.endEntity(java.lang.String)

startCDATA

public void startCDATA()

Specified by:
startCDATA in interface LexicalHandler
Overrides:
startCDATA in class DefaultHandler2
See Also:
DefaultHandler2.startCDATA()

endCDATA

public void endCDATA()

Specified by:
endCDATA in interface LexicalHandler
Overrides:
endCDATA in class DefaultHandler2
See Also:
DefaultHandler2.endCDATA()

characters

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

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
See Also:
DefaultHandler.characters(char[], int, int)

comment

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

Specified by:
comment in interface LexicalHandler
Overrides:
comment in class DefaultHandler2
See Also:
DefaultHandler2.comment(char[], int, int)

startElement

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

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
See Also:
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

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

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
See Also:
XmlHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

warning

public void warning(SAXParseException warning)

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler
See Also:
DefaultHandler.warning(org.xml.sax.SAXParseException)

error

public void error(SAXParseException error)

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
See Also:
DefaultHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(SAXParseException error)

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
See Also:
DefaultHandler.fatalError(org.xml.sax.SAXParseException)


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