|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.serializer.SerializerBase | +--org.apache.xml.serializer.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.
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(Attributes atts)
|
void |
addUniqueAttribute(java.lang.String rawName,
java.lang.String value,
int flags)
Adds a unique attribute to the currenly open tag |
ContentHandler |
asContentHandler()
|
DOMSerializer |
asDOMSerializer()
|
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()
|
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 |
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)
|
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Pass the call on to the underlying handler |
void |
flushPending()
|
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 |
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)
|
java.lang.String |
getNamespaceURIFromPrefix(java.lang.String prefix)
|
boolean |
getOmitXMLDeclaration()
Pass the call on to the underlying handler |
java.util.Properties |
getOutputFormat()
|
java.io.OutputStream |
getOutputStream()
|
java.lang.String |
getPrefix(java.lang.String namespaceURI)
|
java.lang.String |
getStandalone()
Pass the call on to the underlying handler |
Transformer |
getTransformer()
|
java.lang.String |
getVersion()
Pass the call on to the underlying handler |
java.io.Writer |
getWriter()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Pass the call on to the underlying handler |
void |
internalEntityDecl(java.lang.String arg0,
java.lang.String arg1)
Pass the call on to the underlying handler |
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(Node node)
Converts the DOM node to output |
void |
setCdataSectionElements(java.util.Vector URI_and_localNames)
|
void |
setContentHandler(ContentHandler ch)
|
void |
setDoctype(java.lang.String system,
java.lang.String pub)
|
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(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)
|
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)
|
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(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(Transformer t)
|
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()
|
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)
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String elementName,
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)
|
Methods inherited from class org.apache.xml.serializer.SerializerBase |
addAttribute,
addAttributeAlways,
addXSLAttribute,
characters,
error,
fatalError,
fireEndEntity,
notationDecl,
setDTDEntityExpansion,
setNamespaceMappings,
unparsedEntityDecl,
warning |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ToUnknownStream()
Method Detail |
public ContentHandler asContentHandler() throws java.io.IOException
Serializer.asContentHandler()
public void close()
SerializationHandler.close()
public java.util.Properties getOutputFormat()
Serializer.getOutputFormat()
public java.io.OutputStream getOutputStream()
Serializer.getOutputStream()
public java.io.Writer getWriter()
Serializer.getWriter()
public boolean reset()
Serializer.reset()
public void serialize(Node node) throws java.io.IOException
node
- the DOM node to transform to outputDOMSerializer.serialize(Node)
public boolean setEscaping(boolean escape) throws 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 SAXException
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 elementExtendedContentHandler.addAttribute(String, String, String, String, String)
public void addAttribute(java.lang.String rawName, java.lang.String value)
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 SAXException
public void characters(java.lang.String chars) throws SAXException
ExtendedContentHandler.characters(String)
public void endElement(java.lang.String elementName) throws SAXException
ExtendedContentHandler.endElement(String)
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException
prefix
- The prefix that maps to the URIuri
- The URI for the namespaceContentHandler.startPrefixMapping(String, String)
public void namespaceAfterStartElement(java.lang.String prefix, java.lang.String uri) throws SAXException
uri
- the URI of the namespaceprefix
- the prefix associated with the given URI.ExtendedContentHandler.namespaceAfterStartElement(String, String)
public boolean startPrefixMapping(java.lang.String prefix, java.lang.String uri, boolean shouldFlush) throws SAXException
public void setVersion(java.lang.String version)
public void startDocument() throws SAXException
ContentHandler.startDocument()
public void startElement(java.lang.String qName) throws SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String elementName, Attributes atts) throws SAXException
public void comment(java.lang.String comment) throws SAXException
ExtendedLexicalHandler.comment(String)
public java.lang.String getDoctypePublic()
XSLOutputAttributes.getDoctypePublic()
public java.lang.String getDoctypeSystem()
XSLOutputAttributes.getDoctypeSystem()
public java.lang.String getEncoding()
XSLOutputAttributes.getEncoding()
public boolean getIndent()
XSLOutputAttributes.getIndent()
public int getIndentAmount()
XSLOutputAttributes.getIndentAmount()
public java.lang.String getMediaType()
XSLOutputAttributes.getMediaType()
public boolean getOmitXMLDeclaration()
XSLOutputAttributes.getOmitXMLDeclaration()
public java.lang.String getStandalone()
XSLOutputAttributes.getStandalone()
public java.lang.String getVersion()
XSLOutputAttributes.getVersion()
public void setDoctype(java.lang.String system, java.lang.String pub)
XSLOutputAttributes.setDoctype(String, String)
public void setDoctypePublic(java.lang.String doctype)
doctype
- the public doctype to setXSLOutputAttributes.setDoctypePublic(String)
public void setDoctypeSystem(java.lang.String doctype)
doctype
- the system doctype to setXSLOutputAttributes.setDoctypeSystem(String)
public void setEncoding(java.lang.String encoding)
XSLOutputAttributes.setEncoding(String)
public void setIndent(boolean indent)
XSLOutputAttributes.setIndent(boolean)
public void setIndentAmount(int value)
public void setMediaType(java.lang.String mediaType)
XSLOutputAttributes.setMediaType(String)
public void setOmitXMLDeclaration(boolean b)
XSLOutputAttributes.setOmitXMLDeclaration(boolean)
public void setStandalone(java.lang.String standalone)
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 SAXException
DeclHandler.attributeDecl(String, String, String, String, String)
public void elementDecl(java.lang.String arg0, java.lang.String arg1) throws SAXException
DeclHandler.elementDecl(String, String)
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
DeclHandler.externalEntityDecl(String, String, String)
public void internalEntityDecl(java.lang.String arg0, java.lang.String arg1) throws SAXException
DeclHandler.internalEntityDecl(String, String)
public void characters(char[] characters, int offset, int length) throws SAXException
ContentHandler.characters(char[], int, int)
public void endDocument() throws SAXException
ContentHandler.endDocument()
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws SAXException
ContentHandler.endElement(String, String, String)
public void endPrefixMapping(java.lang.String prefix) throws SAXException
ContentHandler.endPrefixMapping(String)
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ContentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
ContentHandler.processingInstruction(String, String)
public void setDocumentLocator(Locator locator)
ContentHandler.setDocumentLocator(Locator)
public void skippedEntity(java.lang.String name) throws SAXException
ContentHandler.skippedEntity(String)
public void comment(char[] ch, int start, int length) throws SAXException
LexicalHandler.comment(char[], int, int)
public void endCDATA() throws SAXException
LexicalHandler.endCDATA()
public void endDTD() throws SAXException
LexicalHandler.endDTD()
public void endEntity(java.lang.String name) throws SAXException
LexicalHandler.endEntity(String)
public void startCDATA() throws SAXException
LexicalHandler.startCDATA()
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
LexicalHandler.startDTD(String, String, String)
public void startEntity(java.lang.String name) throws SAXException
LexicalHandler.startEntity(String)
public DOMSerializer asDOMSerializer() throws java.io.IOException
Serializer.asDOMSerializer()
public void setCdataSectionElements(java.util.Vector URI_and_localNames)
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(Attributes atts) throws SAXException
ExtendedContentHandler.addAttributes(org.xml.sax.Attributes)
public NamespaceMappings getNamespaceMappings()
ExtendedContentHandler.getNamespaceMappings()
public void flushPending() throws SAXException
SerializationHandler.flushPending()
public java.lang.String getPrefix(java.lang.String namespaceURI)
ExtendedContentHandler.getPrefix(java.lang.String)
public void entityReference(java.lang.String entityName) throws SAXException
ExtendedContentHandler.entityReference(java.lang.String)
public java.lang.String getNamespaceURI(java.lang.String qname, boolean isElement)
ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)
public java.lang.String getNamespaceURIFromPrefix(java.lang.String prefix)
public void setTransformer(Transformer t)
public Transformer getTransformer()
public void setContentHandler(ContentHandler ch)
SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)
public void setSourceLocator(SourceLocator locator)
locator
- the source locatorExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |