Class ToUnknownStream
- All Implemented Interfaces:
DOMSerializer,ExtendedContentHandler,ExtendedLexicalHandler,SerializationHandler,Serializer,ContentHandler,DTDHandler,ErrorHandler,DeclHandler,LexicalHandler
public final class ToUnknownStream extends SerializerBase
-
Field Summary
Fields Modifier and Type Field Description static StringCDATA_CONTINUETo insert ]]> in a CDATA section by ending the last CDATA section with ]] and starting the next CDATA section with >static StringCDATA_DELIMITER_CLOSEThe constant "]]>"static StringCDATA_DELIMITER_OPENstatic StringDEFAULT_SAX_SERIALIZERstatic StringENTITY_AMPstatic StringENTITY_CRLFstatic StringENTITY_GTstatic StringENTITY_LTstatic StringENTITY_QUOTstatic StringXML_PREFIXstatic StringXMLNS_PREFIXstatic StringXMLNS_URIstatic StringXMLVERSION10static StringXMLVERSION11Define the XML version.Fields inherited from class org.apache.xml.serializer.SerializerBase
m_attrBuff, m_attributes, m_CdataElems, m_cdataTagOpen, m_charsBuff, m_doctypePublic, m_doctypeSystem, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_mediatype, m_prefixMap, m_shouldNotWriteXMLHeader, m_sourceLocator, m_standaloneWasSpecified, m_StringOfCDATASections, m_tracer, m_version, m_writer, PKG_NAME, PKG_PATHFields inherited from interface org.apache.xml.serializer.ExtendedContentHandler
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS -
Constructor Summary
Constructors Constructor Description ToUnknownStream()Default constructor. -
Method Summary
Modifier and Type Method Description voidaddAttribute(String rawName, String value)Adds an attribute to the currenly open tagvoidaddAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)Adds an attribute to the currenly open tagvoidaddAttributes(Attributes atts)Add the given attributes to the currently collected ones.voidaddUniqueAttribute(String rawName, String value, int flags)Adds a unique attribute to the currenly open tagContentHandlerasContentHandler()Return aContentHandlerinterface into this serializer.ObjectasDOM3Serializer()Return aDOM3Serializerinterface into this serializer.DOMSerializerasDOMSerializer()Return aDOMSerializerinterface into this serializer.voidattributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)Pass the call on to the underlying handlervoidcharacters(char[] characters, int offset, int length)Pass the call on to the underlying handlervoidcharacters(String chars)Converts the String to a character array and calls the SAX method characters(char[],int,int);voidclose()Flush and close the underlying java.io.Writer.voidcomment(char[] ch, int start, int length)Pass the call on to the underlying handlervoidcomment(String comment)Pass the call on to the underlying handlervoidelementDecl(String arg0, String arg1)Pass the call on to the underlying handlervoidendCDATA()Pass the call on to the underlying handlervoidendDocument()Pass the call on to the underlying handlervoidendDTD()Pass the call on to the underlying handlervoidendElement(String elementName)Pass the call on to the underlying handlervoidendElement(String namespaceURI, String localName, String qName)Pass the call on to the underlying handlervoidendEntity(String name)Pass the call on to the underlying handlervoidendPrefixMapping(String prefix)Pass the call on to the underlying handlervoidentityReference(String entityName)Entity reference event.voidexternalEntityDecl(String name, String publicId, String systemId)Pass the call on to the underlying handlerprotected voidfirePseudoElement(String elementName)voidflushPending()A SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement().StringgetDoctypePublic()Pass the call on to the underlying handlerStringgetDoctypeSystem()Pass the call on to the underlying handlerStringgetEncoding()Pass the call on to the underlying handlerbooleangetIndent()Pass the call on to the underlying handlerintgetIndentAmount()Pass the call on to the underlying handlerStringgetMediaType()Pass the call on to the underlying handlerNamespaceMappingsgetNamespaceMappings()Get the current namespace mappings.StringgetNamespaceURI(String qname, boolean isElement)Returns the URI of an element or attribute.StringgetNamespaceURIFromPrefix(String prefix)Returns the URI of prefix (if any)booleangetOmitXMLDeclaration()Pass the call on to the underlying handlerPropertiesgetOutputFormat()Returns the output format properties for this serializer.OutputStreamgetOutputStream()Get the output stream where the events will be serialized to.StringgetPrefix(String namespaceURI)Returns the prefix currently pointing to the given URI (if any).StringgetStandalone()Pass the call on to the underlying handlerTransformergetTransformer()Gets the transformer associated with this serializerStringgetVersion()Pass the call on to the underlying handlerWritergetWriter()Get the character stream where the events will be serialized to.voidignorableWhitespace(char[] ch, int start, int length)Pass the call on to the underlying handlervoidinternalEntityDecl(String arg0, String arg1)Pass the call on to the underlying handlervoidnamespaceAfterStartElement(String prefix, String uri)This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement().voidprocessingInstruction(String target, String data)Pass the call on to the underlying handlerbooleanreset()passes the call on to the underlying HTML or XML handlervoidserialize(Node node)Converts the DOM node to outputvoidsetCdataSectionElements(Vector URI_and_localNames)voidsetContentHandler(ContentHandler ch)Set the SAX Content handler that the serializer sends its output to.voidsetDoctype(String system, String pub)Set the value coming from the xsl:output doctype-public and doctype-system stylesheet propertiesvoidsetDoctypePublic(String doctype)Set the doctype in the underlying XML handler.voidsetDoctypeSystem(String doctype)Set the doctype in the underlying XML handler.voidsetDocumentLocator(Locator locator)Pass the call on to the underlying handlervoidsetEncoding(String encoding)Pass the call on to the underlying handlerbooleansetEscaping(boolean escape)Turns special character escaping on/off.voidsetIndent(boolean indent)Pass the call on to the underlying handlervoidsetIndentAmount(int value)Pass the call on to the underlying handlervoidsetMediaType(String mediaType)Sets the value coming from the xsl:output media-type stylesheet attribute.voidsetOmitXMLDeclaration(boolean b)Pass the call on to the underlying handlervoidsetOutputFormat(Properties format)Set the properties of the handlervoidsetOutputStream(OutputStream output)Sets the output stream to write tovoidsetSourceLocator(SourceLocator locator)This method is used to set the source locator, which might be used to generated an error message.voidsetStandalone(String standalone)Pass the call on to the underlying handlervoidsetTransformer(Transformer t)Sets the transformer associated with this serializervoidsetVersion(String version)This method cannot be cached because default is different in HTML and XML (we need more than a boolean).voidsetWriter(Writer writer)Sets the writer to write tovoidskippedEntity(String name)Pass the call on to the underlying handlervoidstartCDATA()Pass the call on to the underlying handlervoidstartDocument()Receive notification of the beginning of a document.voidstartDTD(String name, String publicId, String systemId)Pass the call on to the underlying handlervoidstartElement(String qName)This method is used to notify of the start of an elementvoidstartElement(String namespaceURI, String localName, String qName)This method is used to notify that an element is starting.voidstartElement(String namespaceURI, String localName, String elementName, Attributes atts)Receive notification of the beginning of an element.voidstartEntity(String name)Pass the call on to the underlying handlervoidstartPrefixMapping(String prefix, String uri)Begin the scope of a prefix-URI Namespace mapping.booleanstartPrefixMapping(String prefix, String uri, boolean shouldFlush)This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.Methods inherited from class org.apache.xml.serializer.SerializerBase
addAttribute, addAttributeAlways, addXSLAttribute, characters, documentIsEmpty, error, fatalError, fireCDATAEvent, fireCharEvent, fireCommentEvent, fireEndDoc, fireEndElem, fireEndEntity, fireEntityReference, fireEscapingEvent, fireStartDoc, fireStartElem, fireStartEntity, getLocalName, getOutputProperty, getOutputPropertyDefault, getOutputPropertyNonDefault, getPrefixPart, initCDATA, isCdataSection, notationDecl, patchName, setDTDEntityExpansion, setNamespaceMappings, setOutputProperty, setOutputPropertyDefault, setStandaloneInternal, startDocumentInternal, unparsedEntityDecl, warning
-
Field Details
-
CDATA_CONTINUE
To insert ]]> in a CDATA section by ending the last CDATA section with ]] and starting the next CDATA section with >- See Also:
- Constant Field Values
-
CDATA_DELIMITER_CLOSE
The constant "]]>"- See Also:
- Constant Field Values
-
CDATA_DELIMITER_OPEN
- See Also:
- Constant Field Values
-
ENTITY_AMP
- See Also:
- Constant Field Values
-
ENTITY_CRLF
- See Also:
- Constant Field Values
-
ENTITY_GT
- See Also:
- Constant Field Values
-
ENTITY_LT
- See Also:
- Constant Field Values
-
ENTITY_QUOT
- See Also:
- Constant Field Values
-
XML_PREFIX
- See Also:
- Constant Field Values
-
XMLNS_PREFIX
- See Also:
- Constant Field Values
-
XMLNS_URI
- See Also:
- Constant Field Values
-
DEFAULT_SAX_SERIALIZER
-
XMLVERSION11
Define the XML version.- See Also:
- Constant Field Values
-
XMLVERSION10
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ToUnknownStream
public ToUnknownStream()Default constructor. Initially this object wraps an XML Stream object, so _handler is never null. That may change later to an HTML Stream object.
-
-
Method Details
-
asContentHandler
Description copied from class:SerializerBaseReturn aContentHandlerinterface into this serializer. If the serializer does not support theContentHandlerinterface, it should return null.- Specified by:
asContentHandlerin interfaceSerializer- Overrides:
asContentHandlerin classSerializerBase- Returns:
- the wrapped XML or HTML handler
- Throws:
IOException- An I/O exception occured- See Also:
Serializer.asContentHandler()
-
close
public void close()Description copied from class:SerializerBaseFlush and close the underlying java.io.Writer. This method applies to ToStream serializers, not ToSAXHandler serializers.- Specified by:
closein interfaceSerializationHandler- Overrides:
closein classSerializerBase- See Also:
SerializationHandler.close()
-
getOutputFormat
Description copied from interface:SerializerReturns the output format properties for this serializer.- Returns:
- the properties of the underlying handler
- See Also:
Serializer.getOutputFormat()
-
getOutputStream
Description copied from interface:SerializerGet the output stream where the events will be serialized to.- Returns:
- the OutputStream of the underlying XML or HTML handler
- See Also:
Serializer.getOutputStream()
-
getWriter
Description copied from interface:SerializerGet the character stream where the events will be serialized to.- Returns:
- the Writer of the underlying XML or HTML handler
- See Also:
Serializer.getWriter()
-
reset
public boolean reset()passes the call on to the underlying HTML or XML handler- Specified by:
resetin interfaceSerializer- Overrides:
resetin classSerializerBase- Returns:
- ???
- See Also:
Serializer.reset()
-
serialize
Converts the DOM node to output- Parameters:
node- the DOM node to transform to output- Throws:
IOException- if an I/O exception occured while serializing- See Also:
DOMSerializer.serialize(Node)
-
setEscaping
Description copied from interface:SerializationHandlerTurns special character escaping on/off. Note that characters will never, even if this option is set to 'true', be escaped within CDATA sections in output XML documents.- Parameters:
escape- true if escaping is to be set on.- Throws:
SAXException- See Also:
SerializationHandler.setEscaping(boolean)
-
setOutputFormat
Set the properties of the handler- Parameters:
format- the output properties to set- See Also:
Serializer.setOutputFormat(Properties)
-
setOutputStream
Sets the output stream to write to- Parameters:
output- the OutputStream to write to- See Also:
Serializer.setOutputStream(OutputStream)
-
setWriter
Sets the writer to write to- Parameters:
writer- the writer to write to- See Also:
Serializer.setWriter(Writer)
-
addAttribute
public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXExceptionAdds an attribute to the currenly open tag- Specified by:
addAttributein interfaceExtendedContentHandler- Overrides:
addAttributein classSerializerBase- Parameters:
uri- the URI of a namespacelocalName- the attribute name, without prefixrawName- the attribute name, with prefix (if any)type- the type of the attribute, typically "CDATA"value- the value of the parameterXSLAttribute- true if this attribute is coming from an xsl:attribute element- Throws:
SAXException- See Also:
ExtendedContentHandler.addAttribute(String, String, String, String, String)
-
addAttribute
Adds an attribute to the currenly open tag- Specified by:
addAttributein interfaceExtendedContentHandler- Overrides:
addAttributein classSerializerBase- Parameters:
rawName- the attribute name, with prefix (if any)value- the value of the parameter- See Also:
ExtendedContentHandler.addAttribute(String, String)
-
addUniqueAttribute
Adds a unique attribute to the currenly open tag- Parameters:
rawName- the fully qualified attribute name.value- the attribute valueflags- a bitwise flag- Throws:
SAXException
-
characters
Converts the String to a character array and calls the SAX method characters(char[],int,int);- Parameters:
chars- the character data- Throws:
SAXException- See Also:
ExtendedContentHandler.characters(String)
-
endElement
Pass the call on to the underlying handler- Parameters:
elementName- the fully qualified element name.- Throws:
SAXException- See Also:
ExtendedContentHandler.endElement(String)
-
startPrefixMapping
Description copied from interface:ContentHandlerBegin the scope of a prefix-URI Namespace mapping.The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the
http://xml.org/sax/features/namespacesfeature is true (the default).There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.
Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the corresponding
startElementevent, and allendPrefixMappingevents will occur immediately after the correspondingendElementevent, but their order is not otherwise guaranteed.There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.
- Parameters:
prefix- The prefix that maps to the URIuri- The URI for the namespace- Throws:
SAXException- the client may throw an exception during processing- See Also:
ContentHandler.startPrefixMapping(String, String)
-
namespaceAfterStartElement
This method is used when a prefix/uri namespace mapping is indicated after the element was started with a startElement() and before and endElement(). startPrefixMapping(prefix,uri) would be used before the startElement() call.- Specified by:
namespaceAfterStartElementin interfaceExtendedContentHandler- Overrides:
namespaceAfterStartElementin classSerializerBase- Parameters:
uri- the URI of the namespaceprefix- the prefix associated with the given URI.- Throws:
SAXException- See Also:
ExtendedContentHandler.namespaceAfterStartElement(String, String)
-
startPrefixMapping
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXExceptionDescription copied from interface:ExtendedContentHandlerThis method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.- Parameters:
prefix- the prefix that maps to the given URIuri- the namespace URI of the given prefixshouldFlush- if true this call is like the SAX startPrefixMapping(prefix,uri) call and the mapping applies to the element to come. If false the mapping applies to the current element.- Returns:
- boolean false if the prefix mapping was already in effect (in other words we are just re-declaring), true if this is a new, never before seen mapping for the element.
- Throws:
SAXException
-
setVersion
This method cannot be cached because default is different in HTML and XML (we need more than a boolean).- Overrides:
setVersionin classSerializerBase- Parameters:
version- the version of the output format.- See Also:
XSLOutputAttributes.setVersion(String)
-
startDocument
Description copied from class:SerializerBaseReceive notification of the beginning of a document. This method is never a self generated call, but only called externally.The SAX parser will invoke this method only once, before any other methods in this interface or in DTDHandler (except for setDocumentLocator).
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classSerializerBase- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.startDocument()
-
startElement
Description copied from interface:ExtendedContentHandlerThis method is used to notify of the start of an element- Parameters:
qName- the fully qualified name of the element- Throws:
SAXException
-
startElement
Description copied from interface:ExtendedContentHandlerThis method is used to notify that an element is starting. This method is just like the standard SAX methodstartElement(uri,localName,qname,atts)
but without the attributes.- Parameters:
namespaceURI- the namespace URI of the elementlocalName- the local name (without prefix) of the elementqName- the qualified name of the element- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String elementName, Attributes atts) throws SAXExceptionDescription copied from interface:ContentHandlerReceive notification of the beginning of an element.The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding
endElementevent for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.This event allows up to three name components for each element:
- the Namespace URI;
- the local name; and
- the qualified (prefixed) name.
Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:
- the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
- the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).
Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the
http://xml.org/sax/features/namespace-prefixesproperty is true (it is false by default, and support for a true value is optional).Like
characters(), attribute values may have characters that need more than onecharvalue.- Parameters:
namespaceURI- the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedlocalName- the local name (without prefix), or the empty string if Namespace processing is not being performedelementName- the qualified name (with prefix), or the empty string if qualified names are not availableatts- the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String),Attributes,AttributesImpl
-
comment
Pass the call on to the underlying handler- Specified by:
commentin interfaceExtendedLexicalHandler- Overrides:
commentin classSerializerBase- Parameters:
comment- the comment, but unlike the SAX comment() method this method takes a String rather than a character array.- Throws:
SAXException- See Also:
ExtendedLexicalHandler.comment(String)
-
getDoctypePublic
Pass the call on to the underlying handler- Overrides:
getDoctypePublicin classSerializerBase- Returns:
- the public identifier to be used in the DOCTYPE declaration in the output document.
- See Also:
XSLOutputAttributes.getDoctypePublic()
-
getDoctypeSystem
Pass the call on to the underlying handler- Overrides:
getDoctypeSystemin classSerializerBase- Returns:
- the system identifier to be used in the DOCTYPE declaration in the output document.
- See Also:
XSLOutputAttributes.getDoctypeSystem()
-
getEncoding
Pass the call on to the underlying handler- Overrides:
getEncodingin classSerializerBase- Returns:
- the character encoding to be used in the output document.
- See Also:
XSLOutputAttributes.getEncoding()
-
getIndent
public boolean getIndent()Pass the call on to the underlying handler- Overrides:
getIndentin classSerializerBase- Returns:
- true if the output document should be indented to visually indicate its structure.
- See Also:
XSLOutputAttributes.getIndent()
-
getIndentAmount
public int getIndentAmount()Pass the call on to the underlying handler- Overrides:
getIndentAmountin classSerializerBase- Returns:
- the number of spaces to indent for each indentation level.
- See Also:
XSLOutputAttributes.getIndentAmount()
-
getMediaType
Pass the call on to the underlying handler- Overrides:
getMediaTypein classSerializerBase- Returns:
- the mediatype the media-type or MIME type associated with the output document.
- See Also:
XSLOutputAttributes.getMediaType()
-
getOmitXMLDeclaration
public boolean getOmitXMLDeclaration()Pass the call on to the underlying handler- Overrides:
getOmitXMLDeclarationin classSerializerBase- Returns:
- true if the XML declaration is to be omitted from the output document.
- See Also:
XSLOutputAttributes.getOmitXMLDeclaration()
-
getStandalone
Pass the call on to the underlying handler- Overrides:
getStandalonein classSerializerBase- Returns:
- a value of "yes" if the
standalonedelaration is to be included in the output document. - See Also:
XSLOutputAttributes.getStandalone()
-
getVersion
Pass the call on to the underlying handler- Overrides:
getVersionin classSerializerBase- Returns:
- the version of the output format.
- See Also:
XSLOutputAttributes.getVersion()
-
setDoctype
Description copied from class:SerializerBaseSet the value coming from the xsl:output doctype-public and doctype-system stylesheet properties- Overrides:
setDoctypein classSerializerBase- Parameters:
system- the system identifier to be used in the DOCTYPE declaration in the output document.pub- the public identifier to be used in the DOCTYPE declaration in the output document.- See Also:
XSLOutputAttributes.setDoctype(String, String)
-
setDoctypePublic
Set the doctype in the underlying XML handler. Remember that this method was called, just in case we need to transfer this doctype to an HTML handler- Overrides:
setDoctypePublicin classSerializerBase- Parameters:
doctype- the public doctype to set- See Also:
XSLOutputAttributes.setDoctypePublic(String)
-
setDoctypeSystem
Set the doctype in the underlying XML handler. Remember that this method was called, just in case we need to transfer this doctype to an HTML handler- Overrides:
setDoctypeSystemin classSerializerBase- Parameters:
doctype- the system doctype to set- See Also:
XSLOutputAttributes.setDoctypeSystem(String)
-
setEncoding
Pass the call on to the underlying handler- Overrides:
setEncodingin classSerializerBase- See Also:
XSLOutputAttributes.setEncoding(String)
-
setIndent
public void setIndent(boolean indent)Pass the call on to the underlying handler- Overrides:
setIndentin classSerializerBase- Parameters:
indent- true if the output document should be indented to visually indicate its structure.- See Also:
XSLOutputAttributes.setIndent(boolean)
-
setIndentAmount
public void setIndentAmount(int value)Pass the call on to the underlying handler- Specified by:
setIndentAmountin interfaceSerializationHandler- Overrides:
setIndentAmountin classSerializerBase- Parameters:
value- The m_indentAmount to set
-
setMediaType
Description copied from class:SerializerBaseSets the value coming from the xsl:output media-type stylesheet attribute.- Overrides:
setMediaTypein classSerializerBase- Parameters:
mediaType- the non-null media-type or MIME type associated with the output document.- See Also:
XSLOutputAttributes.setMediaType(String)
-
setOmitXMLDeclaration
public void setOmitXMLDeclaration(boolean b)Pass the call on to the underlying handler- Overrides:
setOmitXMLDeclarationin classSerializerBase- Parameters:
b- true if the XML declaration is to be omitted from the output document.- See Also:
XSLOutputAttributes.setOmitXMLDeclaration(boolean)
-
setStandalone
Pass the call on to the underlying handler- Overrides:
setStandalonein classSerializerBase- Parameters:
standalone- a value of "yes" indicates that thestandalonedelaration is to be included in the output document. This method remembers if the value was explicitly set using this method, verses if the value is the default value.- See Also:
XSLOutputAttributes.setStandalone(String)
-
attributeDecl
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXExceptionPass the call on to the underlying handler- Parameters:
arg0- The name of the associated element.arg1- The name of the attribute.arg2- A string representing the attribute type.arg3- A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.arg4- A string representing the attribute's default value, or null if there is none.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.attributeDecl(String, String, String, String, String)
-
elementDecl
Pass the call on to the underlying handler- Parameters:
arg0- The element type name.arg1- The content model as a normalized string.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.elementDecl(String, String)
-
externalEntityDecl
Pass the call on to the underlying handler- Parameters:
name- The name of the entity. If it is a parameter entity, the name will begin with '%'.publicId- The entity's public identifier, or null if none was given.systemId- The entity's system identifier.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.externalEntityDecl(String, String, String)
-
internalEntityDecl
Pass the call on to the underlying handler- Parameters:
arg0- The name of the entity. If it is a parameter entity, the name will begin with '%'.arg1- The replacement text of the entity.- Throws:
SAXException- The application may raise an exception.- See Also:
DeclHandler.internalEntityDecl(String, String)
-
characters
Pass the call on to the underlying handler- Parameters:
characters- the characters from the XML documentoffset- the start position in the arraylength- the number of characters to read from the array- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.characters(char[], int, int)
-
endDocument
Pass the call on to the underlying handler- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.endDocument()
-
endElement
Pass the call on to the underlying handler- Parameters:
namespaceURI- the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performedlocalName- the local name (without prefix), or the empty string if Namespace processing is not being performedqName- the qualified XML name (with prefix), or the empty string if qualified names are not available- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.endElement(String, String, String)
-
endPrefixMapping
Pass the call on to the underlying handler- Parameters:
prefix- the prefix that was being mapped. This is the empty string when a default mapping scope ends.- Throws:
SAXException- the client may throw an exception during processing- See Also:
ContentHandler.endPrefixMapping(String)
-
ignorableWhitespace
Pass the call on to the underlying handler- Parameters:
ch- the characters from the XML documentstart- the start position in the arraylength- the number of characters to read from the array- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.ignorableWhitespace(char[], int, int)
-
processingInstruction
Pass the call on to the underlying handler- Parameters:
target- the processing instruction targetdata- the processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.processingInstruction(String, String)
-
setDocumentLocator
Pass the call on to the underlying handler- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classSerializerBase- Parameters:
locator- An object that can return the location of any SAX document event. Receive an object for locating the origin of SAX document events.SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.
The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.
- See Also:
ContentHandler.setDocumentLocator(Locator)
-
skippedEntity
Pass the call on to the underlying handler- Parameters:
name- the name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]"- Throws:
SAXException- any SAX exception, possibly wrapping another exception- See Also:
ContentHandler.skippedEntity(String)
-
comment
Pass the call on to the underlying handler- 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.- See Also:
LexicalHandler.comment(char[], int, int)
-
endCDATA
Pass the call on to the underlying handler- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.endCDATA()
-
endDTD
Pass the call on to the underlying handler- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.endDTD()
-
endEntity
Pass the call on to the underlying handler- Specified by:
endEntityin interfaceLexicalHandler- Overrides:
endEntityin classSerializerBase- Parameters:
name- The name of the entity that is ending.- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.endEntity(String)
-
startCDATA
Pass the call on to the underlying handler- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.startCDATA()
-
startDTD
Pass the call on to the underlying handler- 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. (Note that this is not resolved against the document base URI.)- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.startDTD(String, String, String)
-
startEntity
Pass the call on to the underlying handler- Parameters:
name- The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".- Throws:
SAXException- The application may raise an exception.- See Also:
LexicalHandler.startEntity(String)
-
asDOMSerializer
Description copied from class:SerializerBaseReturn aDOMSerializerinterface into this serializer. If the serializer does not support theDOMSerializerinterface, it should return null.- Specified by:
asDOMSerializerin interfaceSerializer- Overrides:
asDOMSerializerin classSerializerBase- Returns:
- A
DOMSerializerinterface into this serializer, or null if the serializer is not DOM capable - Throws:
IOException- An I/O exception occured- See Also:
Serializer.asDOMSerializer()
-
setCdataSectionElements
- Parameters:
URI_and_localNames- Vector a list of pairs of URI/localName specified in the cdata-section-elements attribute.- See Also:
XSLOutputAttributes.setCdataSectionElements(java.util.Vector)
-
addAttributes
Description copied from class:SerializerBaseAdd the given attributes to the currently collected ones. These attributes are always added, regardless of whether on not an element is currently open.- Specified by:
addAttributesin interfaceExtendedContentHandler- Overrides:
addAttributesin classSerializerBase- Parameters:
atts- List of attributes to add to this list- Throws:
SAXException- See Also:
ExtendedContentHandler.addAttributes(org.xml.sax.Attributes)
-
getNamespaceMappings
Get the current namespace mappings. Simply returns the mappings of the wrapped handler.- Specified by:
getNamespaceMappingsin interfaceExtendedContentHandler- Overrides:
getNamespaceMappingsin classSerializerBase- Returns:
- the current namespace mappings (prefix/uri)
- See Also:
ExtendedContentHandler.getNamespaceMappings()
-
flushPending
Description copied from interface:SerializationHandlerA SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement().If the SerializationHandler has a Writer or OutputStream, a call to this method will flush such accumulated events as a closed start tag for an element.
If the SerializationHandler wraps a ContentHandler, a call to this method will flush such accumulated events as a SAX (not SAX-like) calls to startPrefixMapping() and startElement().
If one calls endDocument() then one need not call this method since a call to endDocument() will do what this method does. However, in some circumstances, such as with document fragments, endDocument() is not called and it may be necessary to call this method to flush any pending events.
For performance reasons this method should not be called very often.
- Throws:
SAXException- See Also:
SerializationHandler.flushPending()
-
getPrefix
Description copied from class:SerializerBaseReturns the prefix currently pointing to the given URI (if any).- Specified by:
getPrefixin interfaceExtendedContentHandler- Overrides:
getPrefixin classSerializerBase- Parameters:
namespaceURI- the uri of the namespace in question- Returns:
- a prefix pointing to the given URI (if any).
- See Also:
ExtendedContentHandler.getPrefix(java.lang.String)
-
entityReference
Description copied from class:SerializerBaseEntity reference event.- Specified by:
entityReferencein interfaceExtendedContentHandler- Overrides:
entityReferencein classSerializerBase- Parameters:
entityName- Name of entity- Throws:
SAXException- See Also:
ExtendedContentHandler.entityReference(java.lang.String)
-
getNamespaceURI
Description copied from class:SerializerBaseReturns the URI of an element or attribute. Note that default namespaces do not apply directly to attributes.- Specified by:
getNamespaceURIin interfaceExtendedContentHandler- Overrides:
getNamespaceURIin classSerializerBase- Parameters:
qname- a qualified nameisElement- true if the qualified name is the name of an element.- Returns:
- returns the namespace URI associated with the qualified name.
- See Also:
ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)
-
getNamespaceURIFromPrefix
Description copied from class:SerializerBaseReturns the URI of prefix (if any)- Specified by:
getNamespaceURIFromPrefixin interfaceExtendedContentHandler- Overrides:
getNamespaceURIFromPrefixin classSerializerBase- Parameters:
prefix- the prefix whose URI is searched for- Returns:
- the namespace URI currently associated with the prefix, null if the prefix is undefined.
-
setTransformer
Description copied from class:SerializerBaseSets the transformer associated with this serializer- Specified by:
setTransformerin interfaceSerializationHandler- Overrides:
setTransformerin classSerializerBase- Parameters:
t- the transformer associated with this serializer.- See Also:
SerializationHandler.setTransformer(Transformer)
-
getTransformer
Description copied from class:SerializerBaseGets the transformer associated with this serializer- Specified by:
getTransformerin interfaceSerializationHandler- Overrides:
getTransformerin classSerializerBase- Returns:
- returns the transformer associated with this serializer.
- See Also:
SerializationHandler.getTransformer()
-
setContentHandler
Description copied from interface:SerializationHandlerSet the SAX Content handler that the serializer sends its output to. This method only applies to a ToSAXHandler, not to a ToStream serializer. -
setSourceLocator
This method is used to set the source locator, which might be used to generated an error message.- Specified by:
setSourceLocatorin interfaceExtendedContentHandler- Overrides:
setSourceLocatorin classSerializerBase- Parameters:
locator- the source locator- See Also:
ExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)
-
firePseudoElement
-
asDOM3Serializer
Description copied from class:SerializerBaseReturn aDOM3Serializerinterface into this serializer. If the serializer does not support theDOM3Serializerinterface, it should return null.- Specified by:
asDOM3Serializerin interfaceSerializer- Overrides:
asDOM3Serializerin classSerializerBase- Returns:
- A
DOM3Serializerinterface into this serializer, or null if the serializer is not DOM capable - Throws:
IOException- An I/O exception occured- See Also:
Serializer.asDOM3Serializer()
-