APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.trax

public Class DOM2TO

extends Object
implements XMLReader, Locator2
Class Inheritance
All Implemented Interfaces
org.xml.sax.ext.Locator2, org.xml.sax.Locator, org.xml.sax.XMLReader
Imports
java.io.IOException, org.w3c.dom.NamedNodeMap, .Node, .Document, com.sun.org.apache.xml.internal.serializer.SerializationHandler, .NamespaceMappings, org.xml.sax.ContentHandler, .DTDHandler, .EntityResolver, .ErrorHandler, .InputSource, .SAXException, .SAXNotRecognizedException, .SAXNotSupportedException, .XMLReader, org.xml.sax.ext.Locator2

Authors
Santiago Pericas-Geertsen, Sunitha Reddy

Field Summary

Modifier and TypeField and Description
private Node
_dom

A reference to the DOM to be traversed.

private SerializationHandler
_handler

A reference to the output handler receiving the events.

private static final String
private String
private static final String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

This class is only used internally so this method should never be called.

public ContentHandler
getContentHandler()

Implements org.xml.sax.XMLReader.getContentHandler.

Return the current content handler.

public DTDHandler
getDTDHandler()

Implements org.xml.sax.XMLReader.getDTDHandler.

This class is only used internally so this method should never be called.

public String
getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity.

public EntityResolver
getEntityResolver()

Implements org.xml.sax.XMLReader.getEntityResolver.

This class is only used internally so this method should never be called.

public ErrorHandler
getErrorHandler()

Implements org.xml.sax.XMLReader.getErrorHandler.

This class is only used internally so this method should never be called.

public boolean
getFeature(String name)

Implements org.xml.sax.XMLReader.getFeature.

This class is only used internally so this method should never be called.

public int
getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

This class is only used internally so this method should never be called.

private String
getNodeTypeFromCode(short code)

public Object
getProperty(String name)

Implements org.xml.sax.XMLReader.getProperty.

This class is only used internally so this method should never be called.

public String
getPublicId()

Implements org.xml.sax.Locator.getPublicId.

This class is only used internally so this method should never be called.

public String
getSystemId()

Implements org.xml.sax.Locator.getSystemId.

This class is only used internally so this method should never be called.

public String
getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity.

public void
parse(InputSource unused)

Implements org.xml.sax.XMLReader.parse.

Parse an XML document.

public void
private void
parse(Node node)

Traverse the DOM and generate TO events for a handler.

public void
parse(String sysId)

Implements org.xml.sax.XMLReader.parse.

This class is only used internally so this method should never be called.

public void
setContentHandler(ContentHandler handler)

Implements org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.

private void
public void
setDTDHandler(DTDHandler handler)

Implements org.xml.sax.XMLReader.setDTDHandler.

This class is only used internally so this method should never be called.

private void
setEncoding(String encoding)

public void
setEntityResolver(EntityResolver resolver)

Implements org.xml.sax.XMLReader.setEntityResolver.

This class is only used internally so this method should never be called.

public void
setErrorHandler(ErrorHandler handler)

Implements org.xml.sax.XMLReader.setErrorHandler.

This class is only used internally so this method should never be called.

public void
setFeature(String name, boolean value)

Implements org.xml.sax.XMLReader.setFeature.

This class is only used internally so this method should never be called.

public void
setProperty(String name, Object value)

Implements org.xml.sax.XMLReader.setProperty.

This class is only used internally so this method should never be called.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_domback to summary
private Node _dom

A reference to the DOM to be traversed.

_handlerback to summary
private SerializationHandler _handler

A reference to the output handler receiving the events.

EMPTYSTRINGback to summary
private static final String EMPTYSTRING
xmlEncodingback to summary
private String xmlEncoding
XMLNS_PREFIXback to summary
private static final String XMLNS_PREFIX
xmlVersionback to summary
private String xmlVersion

Constructor Detail

DOM2TOback to summary
public DOM2TO(Node root, SerializationHandler handler)

Method Detail

getColumnNumberback to summary
public int getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

This class is only used internally so this method should never be called.

getContentHandlerback to summary
public ContentHandler getContentHandler()

Implements org.xml.sax.XMLReader.getContentHandler.

Doc from org.xml.sax.XMLReader.getContentHandler.

Return the current content handler.

getDTDHandlerback to summary
public DTDHandler getDTDHandler()

Implements org.xml.sax.XMLReader.getDTDHandler.

This class is only used internally so this method should never be called.

getEncodingback to summary
public String getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Doc from org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity. If the encoding was declared externally (for example, in a MIME Content-Type header), that will be the name returned. Else if there was an <?xml ...encoding='...'?> declaration at the start of the document, that encoding name will be returned. Otherwise the encoding will been inferred (normally to be UTF-8, or some UTF-16 variant), and that inferred name will be returned.

When an InputSource is used to provide an entity's character stream, this method returns the encoding provided in that input stream.

Note that some recent W3C specifications require that text in some encodings be normalized, using Unicode Normalization Form C, before processing. Such normalization must be performed by applications, and would normally be triggered based on the value returned by this method.

Encoding names may be those used by the underlying JVM, and comparisons should be case-insensitive.

getEntityResolverback to summary
public EntityResolver getEntityResolver()

Implements org.xml.sax.XMLReader.getEntityResolver.

This class is only used internally so this method should never be called.

getErrorHandlerback to summary
public ErrorHandler getErrorHandler()

Implements org.xml.sax.XMLReader.getErrorHandler.

This class is only used internally so this method should never be called.

getFeatureback to summary
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.getFeature.

This class is only used internally so this method should never be called.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.getFeature.

If the feature value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.getFeature.

When the XMLReader recognizes the feature name but cannot determine its value at this time.

getLineNumberback to summary
public int getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

This class is only used internally so this method should never be called.

getNodeTypeFromCodeback to summary
private String getNodeTypeFromCode(short code)
getPropertyback to summary
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.getProperty.

This class is only used internally so this method should never be called.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.getProperty.

If the property value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.getProperty.

When the XMLReader recognizes the property name but cannot determine its value at this time.

getPublicIdback to summary
public String getPublicId()

Implements org.xml.sax.Locator.getPublicId.

This class is only used internally so this method should never be called.

getSystemIdback to summary
public String getSystemId()

Implements org.xml.sax.Locator.getSystemId.

This class is only used internally so this method should never be called.

getXMLVersionback to summary
public String getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Doc from org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity. This will normally be the identifier from the current entity's <?xml version='...' ...?> declaration, or be defaulted by the parser.

parseback to summary
public void parse(InputSource unused) throws IOException, SAXException

Implements org.xml.sax.XMLReader.parse.

Doc from org.xml.sax.XMLReader.parse.

Parse an XML document.

The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same XMLReader object, possibly with a different input source. Configuration of the XMLReader object (such as handler bindings and values established for feature flags and properties) is unchanged by completion of a parse, unless the definition of that aspect of the configuration explicitly specifies other behavior. (For example, feature flags or properties exposing characteristics of the document being parsed.)

During the parse, the XMLReader will provide information about the XML document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

Exceptions
IOException:
An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
SAXException:
Any SAX exception, possibly wrapping another exception.
parseback to summary
public void parse() throws IOException, SAXException
parseback to summary
private void parse(Node node) throws IOException, SAXException

Traverse the DOM and generate TO events for a handler. Notice that we need to handle implicit namespace declarations too.

parseback to summary
public void parse(String sysId) throws IOException, SAXException

Implements org.xml.sax.XMLReader.parse.

This class is only used internally so this method should never be called.

Exceptions
IOException:

Doc from org.xml.sax.XMLReader.parse.

An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

SAXException:

Doc from org.xml.sax.XMLReader.parse.

Any SAX exception, possibly wrapping another exception.

setContentHandlerback to summary
public void setContentHandler(ContentHandler handler)

Implements org.xml.sax.XMLReader.setContentHandler.

Doc from org.xml.sax.XMLReader.setContentHandler.

Allow an application to register a content event handler.

If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

setDocumentInfoback to summary
private void setDocumentInfo(Document document)
setDTDHandlerback to summary
public void setDTDHandler(DTDHandler handler) throws NullPointerException

Implements org.xml.sax.XMLReader.setDTDHandler.

This class is only used internally so this method should never be called.

setEncodingback to summary
private void setEncoding(String encoding)
setEntityResolverback to summary
public void setEntityResolver(EntityResolver resolver) throws NullPointerException

Implements org.xml.sax.XMLReader.setEntityResolver.

This class is only used internally so this method should never be called.

setErrorHandlerback to summary
public void setErrorHandler(ErrorHandler handler) throws NullPointerException

Implements org.xml.sax.XMLReader.setErrorHandler.

This class is only used internally so this method should never be called.

setFeatureback to summary
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.setFeature.

This class is only used internally so this method should never be called.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.setFeature.

If the feature value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.setFeature.

When the XMLReader recognizes the feature name but cannot set the requested value.

setPropertyback to summary
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException

Implements org.xml.sax.XMLReader.setProperty.

This class is only used internally so this method should never be called.

Exceptions
SAXNotRecognizedException:

Doc from org.xml.sax.XMLReader.setProperty.

If the property value can't be assigned or retrieved.

SAXNotSupportedException:

Doc from org.xml.sax.XMLReader.setProperty.

When the XMLReader recognizes the property name but cannot set the requested value.

setXMLVersionback to summary
private void setXMLVersion(String version)