Class TransformerHandlerImpl
- All Implemented Interfaces:
TransformerHandler,ContentHandler,DTDHandler,EntityResolver,ErrorHandler,DeclHandler,LexicalHandler
-
Constructor Summary
ConstructorsConstructorDescriptionTransformerHandlerImpl(org.apache.xalan.transformer.TransformerImpl transformer, boolean doFragment, String baseSystemID) Construct a TransformerHandlerImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoidReport an attribute type declaration.voidcharacters(char[] ch, int start, int length) Filter a character data event.protected voidDo what needs to be done to shut down the CoRoutine management.protected voidDo what needs to be done to shut down the CoRoutine management.voidcomment(char[] ch, int start, int length) Report an XML comment anywhere in the document.voidelementDecl(String name, String model) Report an element type declaration.voidendCDATA()Report the end of a CDATA section.voidFilter an end document event.voidendDTD()Report the end of DTD declarations.voidendElement(String uri, String localName, String qName) Filter an end element event.voidReport the end of an entity.voidendPrefixMapping(String prefix) Filter an end Namespace prefix mapping event.voidFilter an error event.voidexternalEntityDecl(String name, String publicId, String systemId) Report a parsed external entity declaration.voidFilter a fatal error event.Get the base ID (URI or system ID) from where relative URLs will be resolved.Get the Transformer associated with this handler, which is needed in order to set parameters and output properties.voidignorableWhitespace(char[] ch, int start, int length) Filter an ignorable whitespace event.voidinternalEntityDecl(String name, String value) Report an internal entity declaration.voidnotationDecl(String name, String publicId, String systemId) Filter a notation declaration event.voidprocessingInstruction(String target, String data) Filter a processing instruction event.resolveEntity(String publicId, String systemId) Filter an external entity resolution.voidsetDocumentLocator(Locator locator) Filter a new document locator event.voidEnables the user of the TransformerHandler to set the to set the Result for the transformation.voidsetSystemId(String systemID) Set the base ID (URI or system ID) from where relative URLs will be resolved.voidskippedEntity(String name) Filter a skipped entity event.voidReport the start of a CDATA section.voidFilter a start document event.voidReport the start of DTD declarations, if any.voidstartElement(String uri, String localName, String qName, Attributes atts) Filter a start element event.voidstartEntity(String name) Report the beginning of an entity in content.voidstartPrefixMapping(String prefix, String uri) Filter a start Namespace prefix mapping event.voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName) Filter an unparsed entity declaration event.voidFilter a warning event.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
TransformerHandlerImpl
public TransformerHandlerImpl(org.apache.xalan.transformer.TransformerImpl transformer, boolean doFragment, String baseSystemID) Construct a TransformerHandlerImpl.- Parameters:
transformer- Non-null reference to the Xalan transformer impl.doFragment- True if the result should be a document fragement.baseSystemID- The system ID to use as the base for relative URLs.
-
-
Method Details
-
clearCoRoutine
protected void clearCoRoutine()Do what needs to be done to shut down the CoRoutine management. -
clearCoRoutine
Do what needs to be done to shut down the CoRoutine management. -
setResult
Enables the user of the TransformerHandler to set the to set the Result for the transformation.- Specified by:
setResultin interfaceTransformerHandler- Parameters:
result- A Result instance, should not be null.- Throws:
IllegalArgumentException- if result is invalid for some reason.
-
setSystemId
Set the base ID (URI or system ID) from where relative URLs will be resolved.- Specified by:
setSystemIdin interfaceTransformerHandler- Parameters:
systemID- Base URI for the source tree.
-
getSystemId
Get the base ID (URI or system ID) from where relative URLs will be resolved.- Specified by:
getSystemIdin interfaceTransformerHandler- Returns:
- The systemID that was set with
setSystemId(java.lang.String).
-
getTransformer
Get the Transformer associated with this handler, which is needed in order to set parameters and output properties.- Specified by:
getTransformerin interfaceTransformerHandler- Returns:
- The Transformer associated with this handler
-
resolveEntity
Filter an external entity resolution.- Specified by:
resolveEntityin interfaceEntityResolver- Parameters:
publicId- The entity's public identifier, or null.systemId- The entity's system identifier.- Returns:
- A new InputSource or null for the default.
- Throws:
IOExceptionSAXException- The client may throw an exception during processing.IOException- The client may throw an I/O-related exception while obtaining the new InputSource.- See Also:
-
notationDecl
Filter a notation declaration event.- Specified by:
notationDeclin interfaceDTDHandler- Parameters:
name- The notation name.publicId- The notation's public identifier, or null.systemId- The notation's system identifier, or null.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException Filter an unparsed entity declaration event.- Specified by:
unparsedEntityDeclin interfaceDTDHandler- Parameters:
name- The entity name.publicId- The entity's public identifier, or null.systemId- The entity's system identifier, or null.notationName- The name of the associated notation.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
setDocumentLocator
Filter a new document locator event.- Specified by:
setDocumentLocatorin interfaceContentHandler- Parameters:
locator- The document locator.- See Also:
-
startDocument
Filter a start document event.- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
endDocument
Filter an end document event.- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
startPrefixMapping
Filter a start Namespace prefix mapping event.- Specified by:
startPrefixMappingin interfaceContentHandler- Parameters:
prefix- The Namespace prefix.uri- The Namespace URI.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
endPrefixMapping
Filter an end Namespace prefix mapping event.- Specified by:
endPrefixMappingin interfaceContentHandler- Parameters:
prefix- The Namespace prefix.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException Filter a start element event.- Specified by:
startElementin interfaceContentHandler- Parameters:
uri- The element's Namespace URI, or the empty string.localName- The element's local name, or the empty string.qName- The element's qualified (prefixed) name, or the empty string.atts- The element's attributes.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
endElement
Filter an end element event.- Specified by:
endElementin interfaceContentHandler- Parameters:
uri- The element's Namespace URI, or the empty string.localName- The element's local name, or the empty string.qName- The element's qualified (prefixed) name, or the empty string.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
characters
Filter a character data event.- Specified by:
charactersin interfaceContentHandler- Parameters:
ch- An array of characters.start- The starting position in the array.length- The number of characters to use from the array.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
ignorableWhitespace
Filter an ignorable whitespace event.- Specified by:
ignorableWhitespacein interfaceContentHandler- Parameters:
ch- An array of characters.start- The starting position in the array.length- The number of characters to use from the array.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
processingInstruction
Filter a processing instruction event.- Specified by:
processingInstructionin interfaceContentHandler- Parameters:
target- The processing instruction target.data- The text following the target.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
skippedEntity
Filter a skipped entity event.- Specified by:
skippedEntityin interfaceContentHandler- Parameters:
name- The name of the skipped entity.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
warning
Filter a warning event.- Specified by:
warningin interfaceErrorHandler- Parameters:
e- The nwarning as an exception.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
error
Filter an error event.- Specified by:
errorin interfaceErrorHandler- Parameters:
e- The error as an exception.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
fatalError
Filter a fatal error event.- Specified by:
fatalErrorin interfaceErrorHandler- Parameters:
e- The error as an exception.- Throws:
SAXException- The client may throw an exception during processing.- See Also:
-
startDTD
Report the start of DTD declarations, if any.Any declarations are assumed to be in the internal subset unless otherwise indicated by a
startEntityevent.Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.
- Specified by:
startDTDin interfaceLexicalHandler- Parameters:
name- The document type name.publicId- The declared public identifier for the external DTD subset, or null if none was declared.systemId- The declared system identifier for the external DTD subset, or null if none was declared.- Throws:
SAXException- The application may raise an exception.- See Also:
-
endDTD
Report the end of DTD declarations.- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException- The application may raise an exception.- See Also:
-
startEntity
Report the beginning of an entity in content.NOTE: entity references in attribute values -- and the start and end of the document entity -- are never reported.
The start and end of the external DTD subset are reported using the pseudo-name "[dtd]". All other events must be properly nested within start/end entity events.
Note that skipped entities will be reported through the
skippedEntityevent, which is part of the ContentHandler interface.- Specified by:
startEntityin interfaceLexicalHandler- Parameters:
name- The name of the entity. If it is a parameter entity, the name will begin with '%'.- Throws:
SAXException- The application may raise an exception.- See Also:
-
endEntity
Report the end of an entity.- Specified by:
endEntityin interfaceLexicalHandler- Parameters:
name- The name of the entity that is ending.- Throws:
SAXException- The application may raise an exception.- See Also:
-
startCDATA
Report the start of a CDATA section.The contents of the CDATA section will be reported through the regular
charactersevent.- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException- The application may raise an exception.- See Also:
-
endCDATA
Report the end of a CDATA section.- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException- The application may raise an exception.- See Also:
-
comment
Report an XML comment anywhere in the document.This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).
- Specified by:
commentin interfaceLexicalHandler- Parameters:
ch- An array holding the characters in the comment.start- The starting position in the array.length- The number of characters to use from the array.- Throws:
SAXException- The application may raise an exception.
-
elementDecl
Report an element type declaration.The content model will consist of the string "EMPTY", the string "ANY", or a parenthesised group, optionally followed by an occurrence indicator. The model will be normalized so that all whitespace is removed,and will include the enclosing parentheses.
- Specified by:
elementDeclin interfaceDeclHandler- Parameters:
name- The element type name.model- The content model as a normalized string.- Throws:
SAXException- The application may raise an exception.
-
attributeDecl
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException Report an attribute type declaration.Only the effective (first) declaration for an attribute will be reported. The type will be one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION", or a parenthesized token group with the separator "|" and all whitespace removed.
- Specified by:
attributeDeclin interfaceDeclHandler- Parameters:
eName- The name of the associated element.aName- The name of the attribute.type- A string representing the attribute type.valueDefault- A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.value- A string representing the attribute's default value, or null if there is none.- Throws:
SAXException- The application may raise an exception.
-
internalEntityDecl
Report an internal entity declaration.Only the effective (first) declaration for each entity will be reported.
- Specified by:
internalEntityDeclin interfaceDeclHandler- Parameters:
name- The name of the entity. If it is a parameter entity, the name will begin with '%'.value- The replacement text of the entity.- Throws:
SAXException- The application may raise an exception.- See Also:
-
externalEntityDecl
Report a parsed external entity declaration.Only the effective (first) declaration for each entity will be reported.
- Specified by:
externalEntityDeclin interfaceDeclHandler- Parameters:
name- The name of the entity. If it is a parameter entity, the name will begin with '%'.publicId- The declared public identifier of the entity, or null if none was declared.systemId- The declared system identifier of the entity.- Throws:
SAXException- The application may raise an exception.- See Also:
-