|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.serializer.SerializerBase org.apache.xml.serializer.ToUnknownStream
public final class ToUnknownStream
This class wraps another SerializationHandler. The wrapped object will either handler XML or HTML, which is not known until a little later when the first XML tag is seen. If the first tag is then the wrapped object is an HTML handler, otherwise it is an XML handler. This class effectively caches the first few calls to it then passes them on to the wrapped handler (once it exists). After that subsequent calls a simply passed directly to the wrapped handler. The user of this class doesn't know if the output is ultimatley XML or HTML. This class is not a public API, it is public because it is used within Xalan.
Field Summary | |
---|---|
private static java.lang.String |
EMPTYSTRING
A String with no characters |
private java.lang.String |
m_firstElementLocalName
the local name (no prefix) associated with the first element |
private java.lang.String |
m_firstElementName
the element name (including any prefix) of the very first tag in the document |
private java.lang.String |
m_firstElementPrefix
the prefix of the very first tag in the document |
private java.lang.String |
m_firstElementURI
the namespace URI associated with the first element |
private boolean |
m_firstTagNotEmitted
true if the first tag has been emitted to the wrapped handler |
private SerializationHandler |
m_handler
The wrapped handler, initially XML but possibly switched to HTML |
private java.util.Vector |
m_namespacePrefix
A collection of namespace Prefix (only for first element) _namespaceURI has the matching URIs for these prefix' |
private java.util.Vector |
m_namespaceURI
A collection of namespace URI's (only for first element). |
private boolean |
m_needToCallStartDocument
true if startDocument() was called before the underlying handler was initialized |
private boolean |
m_setDoctypePublic_called
true if setDoctypePublic() was called before the underlying handler was initialized |
private boolean |
m_setDoctypeSystem_called
true if setDoctypeSystem() was called before the underlying handler was initialized |
private boolean |
m_setMediaType_called
true if setMediaType() was called before the underlying handler was initialized |
private boolean |
m_setVersion_called
true if setVersion() was called before the underlying handler was initialized |
private boolean |
m_wrapped_handler_not_initialized
true if the underlying handler (XML or HTML) is fully initialized |
Fields inherited from class org.apache.xml.serializer.SerializerBase |
---|
m_attrBuff, m_attributes, m_CdataElems, m_cdataTagOpen, m_charsBuff, m_docIsEmpty, m_doctypePublic, m_doctypeSystem, m_doIndent, m_elemContext, m_indentAmount, m_inEntityRef, m_inExternalDTD, m_mediatype, m_needToOutputDocTypeDecl, m_prefixMap, m_shouldNotWriteXMLHeader, m_sourceLocator, m_standaloneWasSpecified, m_StringOfCDATASections, m_tracer, m_version, m_writer, PKG_NAME, PKG_PATH |
Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler |
---|
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS |
Fields inherited from interface org.apache.xml.serializer.SerializerConstants |
---|
CDATA_CONTINUE, CDATA_DELIMITER_CLOSE, CDATA_DELIMITER_OPEN, DEFAULT_SAX_SERIALIZER, ENTITY_AMP, ENTITY_CRLF, ENTITY_GT, ENTITY_LT, ENTITY_QUOT, XML_PREFIX, XMLNS_PREFIX, XMLNS_URI, XMLVERSION10, XMLVERSION11 |
Constructor Summary | |
---|---|
ToUnknownStream()
Default constructor. |
Method Summary | |
---|---|
void |
addAttribute(java.lang.String rawName,
java.lang.String value)
Adds an attribute to the currenly open tag |
void |
addAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
java.lang.String type,
java.lang.String value,
boolean XSLAttribute)
Adds an attribute to the currenly open tag |
void |
addAttributes(org.xml.sax.Attributes atts)
Add the given attributes to the currently collected ones. |
void |
addUniqueAttribute(java.lang.String rawName,
java.lang.String value,
int flags)
Adds a unique attribute to the currenly open tag |
org.xml.sax.ContentHandler |
asContentHandler()
Return a ContentHandler interface into this serializer. |
java.lang.Object |
asDOM3Serializer()
Return a DOM3Serializer interface into this serializer. |
DOMSerializer |
asDOMSerializer()
Return a DOMSerializer interface into this serializer. |
void |
attributeDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3,
java.lang.String arg4)
Pass the call on to the underlying handler |
void |
characters(char[] characters,
int offset,
int length)
Pass the call on to the underlying handler |
void |
characters(java.lang.String chars)
Converts the String to a character array and calls the SAX method characters(char[],int,int); |
void |
close()
Flush and close the underlying java.io.Writer. |
void |
comment(char[] ch,
int start,
int length)
Pass the call on to the underlying handler |
void |
comment(java.lang.String comment)
Pass the call on to the underlying handler |
void |
elementDecl(java.lang.String arg0,
java.lang.String arg1)
Pass the call on to the underlying handler |
private void |
emitFirstTag()
|
void |
endCDATA()
Pass the call on to the underlying handler |
void |
endDocument()
Pass the call on to the underlying handler |
void |
endDTD()
Pass the call on to the underlying handler |
void |
endElement(java.lang.String elementName)
Pass the call on to the underlying handler |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
Pass the call on to the underlying handler |
void |
endEntity(java.lang.String name)
Pass the call on to the underlying handler |
void |
endPrefixMapping(java.lang.String prefix)
Pass the call on to the underlying handler |
void |
entityReference(java.lang.String entityName)
Entity reference event. |
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Pass the call on to the underlying handler |
protected void |
firePseudoElement(java.lang.String elementName)
|
private void |
flush()
|
void |
flushPending()
A SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement(). |
java.lang.String |
getDoctypePublic()
Pass the call on to the underlying handler |
java.lang.String |
getDoctypeSystem()
Pass the call on to the underlying handler |
java.lang.String |
getEncoding()
Pass the call on to the underlying handler |
boolean |
getIndent()
Pass the call on to the underlying handler |
int |
getIndentAmount()
Pass the call on to the underlying handler |
private java.lang.String |
getLocalNameUnknown(java.lang.String value)
Utility function for calls to local-name(). |
java.lang.String |
getMediaType()
Pass the call on to the underlying handler |
NamespaceMappings |
getNamespaceMappings()
Get the current namespace mappings. |
java.lang.String |
getNamespaceURI(java.lang.String qname,
boolean isElement)
Returns the URI of an element or attribute. |
java.lang.String |
getNamespaceURIFromPrefix(java.lang.String prefix)
Returns the URI of prefix (if any) |
boolean |
getOmitXMLDeclaration()
Pass the call on to the underlying handler |
java.util.Properties |
getOutputFormat()
Returns the output format properties for this serializer. |
java.io.OutputStream |
getOutputStream()
Get the output stream where the events will be serialized to. |
java.lang.String |
getPrefix(java.lang.String namespaceURI)
Returns the prefix currently pointing to the given URI (if any). |
private java.lang.String |
getPrefixPartUnknown(java.lang.String qname)
Utility function to return prefix Don't want to override static function on SerializerBase So added Unknown suffix to method name. |
java.lang.String |
getStandalone()
Pass the call on to the underlying handler |
javax.xml.transform.Transformer |
getTransformer()
Gets the transformer associated with this serializer |
java.lang.String |
getVersion()
Pass the call on to the underlying handler |
java.io.Writer |
getWriter()
Get the character stream where the events will be serialized to. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Pass the call on to the underlying handler |
private void |
initStreamOutput()
Initialize the wrapped output stream (XML or HTML). |
void |
internalEntityDecl(java.lang.String arg0,
java.lang.String arg1)
Pass the call on to the underlying handler |
private boolean |
isFirstElemHTML()
Determine if the firts element in the document is or This uses the cached first element name, first element prefix and the cached namespaces from previous method calls |
void |
namespaceAfterStartElement(java.lang.String prefix,
java.lang.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(). |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Pass the call on to the underlying handler |
boolean |
reset()
passes the call on to the underlying HTML or XML handler |
void |
serialize(org.w3c.dom.Node node)
Converts the DOM node to output |
void |
setCdataSectionElements(java.util.Vector URI_and_localNames)
Sets the value coming from the xsl:output cdata-section-elements stylesheet property. |
void |
setContentHandler(org.xml.sax.ContentHandler ch)
Set the SAX Content handler that the serializer sends its output to. |
void |
setDoctype(java.lang.String system,
java.lang.String pub)
Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties |
void |
setDoctypePublic(java.lang.String doctype)
Set the doctype in the underlying XML handler. |
void |
setDoctypeSystem(java.lang.String doctype)
Set the doctype in the underlying XML handler. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Pass the call on to the underlying handler |
void |
setEncoding(java.lang.String encoding)
Pass the call on to the underlying handler |
boolean |
setEscaping(boolean escape)
Turns special character escaping on/off. |
void |
setIndent(boolean indent)
Pass the call on to the underlying handler |
void |
setIndentAmount(int value)
Pass the call on to the underlying handler |
void |
setMediaType(java.lang.String mediaType)
Sets the value coming from the xsl:output media-type stylesheet attribute. |
void |
setOmitXMLDeclaration(boolean b)
Pass the call on to the underlying handler |
void |
setOutputFormat(java.util.Properties format)
Set the properties of the handler |
void |
setOutputStream(java.io.OutputStream output)
Sets the output stream to write to |
void |
setSourceLocator(javax.xml.transform.SourceLocator locator)
This method is used to set the source locator, which might be used to generated an error message. |
void |
setStandalone(java.lang.String standalone)
Pass the call on to the underlying handler |
void |
setTransformer(javax.xml.transform.Transformer t)
Sets the transformer associated with this serializer |
void |
setVersion(java.lang.String version)
This method cannot be cached because default is different in HTML and XML (we need more than a boolean). |
void |
setWriter(java.io.Writer writer)
Sets the writer to write to |
void |
skippedEntity(java.lang.String name)
Pass the call on to the underlying handler |
void |
startCDATA()
Pass the call on to the underlying handler |
void |
startDocument()
Receive notification of the beginning of a document. |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Pass the call on to the underlying handler |
void |
startElement(java.lang.String qName)
This method is used to notify of the start of an element |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
This method is used to notify that an element is starting. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String elementName,
org.xml.sax.Attributes atts)
|
void |
startEntity(java.lang.String name)
Pass the call on to the underlying handler |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
boolean |
startPrefixMapping(java.lang.String prefix,
java.lang.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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SerializationHandler m_handler
private static final java.lang.String EMPTYSTRING
private boolean m_wrapped_handler_not_initialized
private java.lang.String m_firstElementPrefix
private java.lang.String m_firstElementName
private java.lang.String m_firstElementURI
private java.lang.String m_firstElementLocalName
private boolean m_firstTagNotEmitted
private java.util.Vector m_namespaceURI
private java.util.Vector m_namespacePrefix
private boolean m_needToCallStartDocument
private boolean m_setVersion_called
private boolean m_setDoctypeSystem_called
private boolean m_setDoctypePublic_called
private boolean m_setMediaType_called
Constructor Detail |
---|
public ToUnknownStream()
Method Detail |
---|
public org.xml.sax.ContentHandler asContentHandler() throws java.io.IOException
SerializerBase
ContentHandler
interface into this serializer.
If the serializer does not support the ContentHandler
interface, it should return null.
asContentHandler
in interface Serializer
asContentHandler
in class SerializerBase
java.io.IOException
- An I/O exception occuredSerializer.asContentHandler()
public void close()
SerializerBase
close
in interface SerializationHandler
close
in class SerializerBase
SerializationHandler.close()
public java.util.Properties getOutputFormat()
Serializer
Serializer.getOutputFormat()
public java.io.OutputStream getOutputStream()
Serializer
Serializer.getOutputStream()
public java.io.Writer getWriter()
Serializer
Serializer.getWriter()
public boolean reset()
reset
in interface Serializer
reset
in class SerializerBase
Serializer.reset()
public void serialize(org.w3c.dom.Node node) throws java.io.IOException
node
- the DOM node to transform to output
java.io.IOException
- if an I/O exception occured while serializingDOMSerializer.serialize(Node)
public boolean setEscaping(boolean escape) throws org.xml.sax.SAXException
SerializationHandler
escape
- true if escaping is to be set on.
org.xml.sax.SAXException
SerializationHandler.setEscaping(boolean)
public void setOutputFormat(java.util.Properties format)
format
- the output properties to setSerializer.setOutputFormat(Properties)
public void setOutputStream(java.io.OutputStream output)
output
- the OutputStream to write toSerializer.setOutputStream(OutputStream)
public void setWriter(java.io.Writer writer)
writer
- the writer to write toSerializer.setWriter(Writer)
public void addAttribute(java.lang.String uri, java.lang.String localName, java.lang.String rawName, java.lang.String type, java.lang.String value, boolean XSLAttribute) throws org.xml.sax.SAXException
addAttribute
in interface ExtendedContentHandler
addAttribute
in class SerializerBase
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
org.xml.sax.SAXException
ExtendedContentHandler.addAttribute(String, String, String, String, String)
public void addAttribute(java.lang.String rawName, java.lang.String value)
addAttribute
in interface ExtendedContentHandler
addAttribute
in class SerializerBase
rawName
- the attribute name, with prefix (if any)value
- the value of the parameterExtendedContentHandler.addAttribute(String, String)
public void addUniqueAttribute(java.lang.String rawName, java.lang.String value, int flags) throws org.xml.sax.SAXException
rawName
- the fully qualified attribute name.value
- the attribute valueflags
- a bitwise flag
org.xml.sax.SAXException
public void characters(java.lang.String chars) throws org.xml.sax.SAXException
chars
- the character data
org.xml.sax.SAXException
ExtendedContentHandler.characters(String)
public void endElement(java.lang.String elementName) throws org.xml.sax.SAXException
elementName
- the fully qualified element name.
org.xml.sax.SAXException
ExtendedContentHandler.endElement(String)
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
prefix
- The prefix that maps to the URIuri
- The URI for the namespace
org.xml.sax.SAXException
ContentHandler.startPrefixMapping(String, String)
public void namespaceAfterStartElement(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
namespaceAfterStartElement
in interface ExtendedContentHandler
namespaceAfterStartElement
in class SerializerBase
uri
- the URI of the namespaceprefix
- the prefix associated with the given URI.
org.xml.sax.SAXException
ExtendedContentHandler.namespaceAfterStartElement(String, String)
public boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri, boolean shouldFlush) throws org.xml.sax.SAXException
ExtendedContentHandler
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.
org.xml.sax.SAXException
public void setVersion(java.lang.String version)
setVersion
in interface XSLOutputAttributes
setVersion
in class SerializerBase
version
- the version of the output format.XSLOutputAttributes.setVersion(String)
public void startDocument() throws org.xml.sax.SAXException
SerializerBase
The SAX parser will invoke this method only once, before any other methods in this interface or in DTDHandler (except for setDocumentLocator).
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class SerializerBase
org.xml.sax.SAXException
ContentHandler.startDocument()
public void startElement(java.lang.String qName) throws org.xml.sax.SAXException
ExtendedContentHandler
qName
- the fully qualified name of the element
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
ExtendedContentHandler
startElement(uri,localName,qname,atts)but without the attributes.
namespaceURI
- the namespace URI of the elementlocalName
- the local name (without prefix) of the elementqName
- the qualified name of the element
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String elementName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void comment(java.lang.String comment) throws org.xml.sax.SAXException
comment
in interface ExtendedLexicalHandler
comment
in class SerializerBase
comment
- the comment, but unlike the SAX comment() method this
method takes a String rather than a character array.
org.xml.sax.SAXException
ExtendedLexicalHandler.comment(String)
public java.lang.String getDoctypePublic()
getDoctypePublic
in interface XSLOutputAttributes
getDoctypePublic
in class SerializerBase
XSLOutputAttributes.getDoctypePublic()
public java.lang.String getDoctypeSystem()
getDoctypeSystem
in interface XSLOutputAttributes
getDoctypeSystem
in class SerializerBase
XSLOutputAttributes.getDoctypeSystem()
public java.lang.String getEncoding()
getEncoding
in interface XSLOutputAttributes
getEncoding
in class SerializerBase
XSLOutputAttributes.getEncoding()
public boolean getIndent()
getIndent
in interface XSLOutputAttributes
getIndent
in class SerializerBase
XSLOutputAttributes.getIndent()
public int getIndentAmount()
getIndentAmount
in interface XSLOutputAttributes
getIndentAmount
in class SerializerBase
XSLOutputAttributes.getIndentAmount()
public java.lang.String getMediaType()
getMediaType
in interface XSLOutputAttributes
getMediaType
in class SerializerBase
XSLOutputAttributes.getMediaType()
public boolean getOmitXMLDeclaration()
getOmitXMLDeclaration
in interface XSLOutputAttributes
getOmitXMLDeclaration
in class SerializerBase
XSLOutputAttributes.getOmitXMLDeclaration()
public java.lang.String getStandalone()
getStandalone
in interface XSLOutputAttributes
getStandalone
in class SerializerBase
standalone
delaration is to
be included in the output document.XSLOutputAttributes.getStandalone()
public java.lang.String getVersion()
getVersion
in interface XSLOutputAttributes
getVersion
in class SerializerBase
XSLOutputAttributes.getVersion()
public void setDoctype(java.lang.String system, java.lang.String pub)
SerializerBase
setDoctype
in interface XSLOutputAttributes
setDoctype
in class SerializerBase
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.XSLOutputAttributes.setDoctype(String, String)
public void setDoctypePublic(java.lang.String doctype)
setDoctypePublic
in interface XSLOutputAttributes
setDoctypePublic
in class SerializerBase
doctype
- the public doctype to setXSLOutputAttributes.setDoctypePublic(String)
public void setDoctypeSystem(java.lang.String doctype)
setDoctypeSystem
in interface XSLOutputAttributes
setDoctypeSystem
in class SerializerBase
doctype
- the system doctype to setXSLOutputAttributes.setDoctypeSystem(String)
public void setEncoding(java.lang.String encoding)
setEncoding
in interface XSLOutputAttributes
setEncoding
in class SerializerBase
encoding
- the character encodingXSLOutputAttributes.setEncoding(String)
public void setIndent(boolean indent)
setIndent
in interface XSLOutputAttributes
setIndent
in class SerializerBase
indent
- true if the output document should be indented to
visually indicate its structure.XSLOutputAttributes.setIndent(boolean)
public void setIndentAmount(int value)
setIndentAmount
in interface SerializationHandler
setIndentAmount
in class SerializerBase
value
- The m_indentAmount to setpublic void setMediaType(java.lang.String mediaType)
SerializerBase
setMediaType
in interface XSLOutputAttributes
setMediaType
in class SerializerBase
mediaType
- the non-null media-type or MIME type associated with the
output document.XSLOutputAttributes.setMediaType(String)
public void setOmitXMLDeclaration(boolean b)
setOmitXMLDeclaration
in interface XSLOutputAttributes
setOmitXMLDeclaration
in class SerializerBase
b
- true if the XML declaration is to be omitted from the output
document.XSLOutputAttributes.setOmitXMLDeclaration(boolean)
public void setStandalone(java.lang.String standalone)
setStandalone
in interface XSLOutputAttributes
setStandalone
in class SerializerBase
standalone
- a value of "yes" indicates that the
standalone
delaration 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.XSLOutputAttributes.setStandalone(String)
public void attributeDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4) throws org.xml.sax.SAXException
org.xml.sax.SAXException
DeclHandler.attributeDecl(String, String, String, String, String)
public void elementDecl(java.lang.String arg0, java.lang.String arg1) throws org.xml.sax.SAXException
org.xml.sax.SAXException
DeclHandler.elementDecl(String, String)
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
org.xml.sax.SAXException
DeclHandler.externalEntityDecl(String, String, String)
public void internalEntityDecl(java.lang.String arg0, java.lang.String arg1) throws org.xml.sax.SAXException
org.xml.sax.SAXException
DeclHandler.internalEntityDecl(String, String)
public void characters(char[] characters, int offset, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.characters(char[], int, int)
public void endDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.endDocument()
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.endElement(String, String, String)
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.endPrefixMapping(String)
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.processingInstruction(String, String)
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class SerializerBase
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.
ContentHandler.setDocumentLocator(Locator)
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.skippedEntity(String)
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.comment(char[], int, int)
public void endCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.endCDATA()
public void endDTD() throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.endDTD()
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
endEntity
in class SerializerBase
name
- The name of the entity that is ending.
org.xml.sax.SAXException
- The application may raise an exception.LexicalHandler.endEntity(String)
public void startCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.startCDATA()
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.startDTD(String, String, String)
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
org.xml.sax.SAXException
LexicalHandler.startEntity(String)
private void initStreamOutput() throws org.xml.sax.SAXException
org.xml.sax.SAXException
private void emitFirstTag() throws org.xml.sax.SAXException
org.xml.sax.SAXException
private java.lang.String getLocalNameUnknown(java.lang.String value)
private java.lang.String getPrefixPartUnknown(java.lang.String qname)
private boolean isFirstElemHTML()
public DOMSerializer asDOMSerializer() throws java.io.IOException
SerializerBase
DOMSerializer
interface into this serializer. If the
serializer does not support the DOMSerializer
interface, it should
return null.
asDOMSerializer
in interface Serializer
asDOMSerializer
in class SerializerBase
DOMSerializer
interface into this serializer, or null
if the serializer is not DOM capable
java.io.IOException
- An I/O exception occuredSerializer.asDOMSerializer()
public void setCdataSectionElements(java.util.Vector URI_and_localNames)
XSLOutputAttributes
URI_and_localNames
- Vector a list of pairs of URI/localName
specified in the cdata-section-elements attribute.XSLOutputAttributes.setCdataSectionElements(java.util.Vector)
public void addAttributes(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
SerializerBase
addAttributes
in interface ExtendedContentHandler
addAttributes
in class SerializerBase
atts
- List of attributes to add to this list
org.xml.sax.SAXException
ExtendedContentHandler.addAttributes(org.xml.sax.Attributes)
public NamespaceMappings getNamespaceMappings()
getNamespaceMappings
in interface ExtendedContentHandler
getNamespaceMappings
in class SerializerBase
ExtendedContentHandler.getNamespaceMappings()
public void flushPending() throws org.xml.sax.SAXException
SerializationHandler
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.
org.xml.sax.SAXException
SerializationHandler.flushPending()
private void flush()
public java.lang.String getPrefix(java.lang.String namespaceURI)
SerializerBase
getPrefix
in interface ExtendedContentHandler
getPrefix
in class SerializerBase
namespaceURI
- the uri of the namespace in question
ExtendedContentHandler.getPrefix(java.lang.String)
public void entityReference(java.lang.String entityName) throws org.xml.sax.SAXException
SerializerBase
entityReference
in interface ExtendedContentHandler
entityReference
in class SerializerBase
entityName
- Name of entity
org.xml.sax.SAXException
ExtendedContentHandler.entityReference(java.lang.String)
public java.lang.String getNamespaceURI(java.lang.String qname, boolean isElement)
SerializerBase
getNamespaceURI
in interface ExtendedContentHandler
getNamespaceURI
in class SerializerBase
qname
- a qualified nameisElement
- true if the qualified name is the name of
an element.
ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)
public java.lang.String getNamespaceURIFromPrefix(java.lang.String prefix)
SerializerBase
getNamespaceURIFromPrefix
in interface ExtendedContentHandler
getNamespaceURIFromPrefix
in class SerializerBase
prefix
- the prefix whose URI is searched for
public void setTransformer(javax.xml.transform.Transformer t)
SerializerBase
setTransformer
in interface SerializationHandler
setTransformer
in class SerializerBase
t
- the transformer associated with this serializer.SerializationHandler.setTransformer(Transformer)
public javax.xml.transform.Transformer getTransformer()
SerializerBase
getTransformer
in interface SerializationHandler
getTransformer
in class SerializerBase
SerializationHandler.getTransformer()
public void setContentHandler(org.xml.sax.ContentHandler ch)
SerializationHandler
SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)
public void setSourceLocator(javax.xml.transform.SourceLocator locator)
setSourceLocator
in interface ExtendedContentHandler
setSourceLocator
in class SerializerBase
locator
- the source locatorExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)
protected void firePseudoElement(java.lang.String elementName)
public java.lang.Object asDOM3Serializer() throws java.io.IOException
SerializerBase
DOM3Serializer
interface into this serializer. If the
serializer does not support the DOM3Serializer
interface, it should
return null.
asDOM3Serializer
in interface Serializer
asDOM3Serializer
in class SerializerBase
DOM3Serializer
interface into this serializer, or null
if the serializer is not DOM capable
java.io.IOException
- An I/O exception occuredSerializer.asDOM3Serializer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |