Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xml.serializer.SerializerBase
org.apache.xml.serializer.ToUnknownStream
public class ToUnknownStream
extends SerializerBase
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 | |
BEGCDATA , CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , CNTCDATA , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENDCDATA , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XML_PREFIX |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
ContentHandler | |
DOMSerializer | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
String |
|
String |
|
String |
|
boolean |
|
int |
|
String |
|
NamespaceMappings |
|
String |
|
String |
|
boolean |
|
Properties | |
OutputStream | |
String |
|
String |
|
Transformer |
|
String |
|
Writer | |
void |
|
void |
|
void |
|
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
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.
public void addAttribute(String rawName, String value)
Adds an attribute to the currenly open tag
- Specified by:
- addAttribute in interface ExtendedContentHandler
- Overrides:
- addAttribute in interface SerializerBase
- Parameters:
value
- the value of the parameter
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException
Adds an attribute to the currenly open tag
- Specified by:
- addAttribute in interface ExtendedContentHandler
- Overrides:
- addAttribute in interface SerializerBase
- 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 parameter
public void addAttributes(Attributes atts) throws SAXException
- Overrides:
- addAttributes in interface SerializerBase
public void addUniqueAttribute(String rawName, String value, int flags) throws SAXException
Adds a unique attribute to the currenly open tag
- Specified by:
- addUniqueAttribute in interface ExtendedContentHandler
public ContentHandler asContentHandler() throws IOException
- Specified by:
- asContentHandler in interface Serializer
- Overrides:
- asContentHandler in interface SerializerBase
- Returns:
- the wrapped XML or HTML handler
- See Also:
Serializer.asContentHandler()
public DOMSerializer asDOMSerializer() throws IOException
- Specified by:
- asDOMSerializer in interface Serializer
- Overrides:
- asDOMSerializer in interface SerializerBase
- See Also:
Serializer.asDOMSerializer()
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.DeclHandler.attributeDecl(String, String, String, String, String)
public void characters(String chars) throws SAXException
Converts the String to a character array and calls the SAX method characters(char[],int,int);
- Specified by:
- characters in interface ExtendedContentHandler
public void characters(char[] characters, int offset, int length) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.characters(char[], int, int)
public void close()
- Specified by:
- close in interface SerializationHandler
- Overrides:
- close in interface SerializerBase
- See Also:
SerializationHandler.close()
public void comment(String comment) throws SAXException
Pass the call on to the underlying handler
- Specified by:
- comment in interface ExtendedLexicalHandler
- Overrides:
- comment in interface SerializerBase
public void comment(char[] ch, int start, int length) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.comment(char[], int, int)
public void elementDecl(String arg0, String arg1) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.DeclHandler.elementDecl(String, String)
public void endCDATA() throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.endCDATA()
public void endDTD() throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.endDTD()
public void endDocument() throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.endDocument()
public void endElement(String elementName) throws SAXException
Pass the call on to the underlying handler
- Specified by:
- endElement in interface ExtendedContentHandler
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.endElement(String, String, String)
public void endEntity(String name) throws SAXException
Pass the call on to the underlying handler
- Overrides:
- endEntity in interface SerializerBase
- See Also:
org.xml.sax.ext.LexicalHandler.endEntity(String)
public void endPrefixMapping(String prefix) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.endPrefixMapping(String)
public void entityReference(String entityName) throws SAXException
- Specified by:
- entityReference in interface ExtendedContentHandler
- Overrides:
- entityReference in interface SerializerBase
- See Also:
org.apache.xml.serializer.ExtendedContentHandler.entityReference(java.lang.String)
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.DeclHandler.externalEntityDecl(String, String, String)
public void flushPending() throws SAXException
- Specified by:
- flushPending in interface SerializationHandler
- See Also:
SerializationHandler.flushPending()
public String getDoctypePublic()
Pass the call on to the underlying handler
- Specified by:
- getDoctypePublic in interface XSLOutputAttributes
- Overrides:
- getDoctypePublic in interface SerializerBase
public String getDoctypeSystem()
Pass the call on to the underlying handler
- Specified by:
- getDoctypeSystem in interface XSLOutputAttributes
- Overrides:
- getDoctypeSystem in interface SerializerBase
public String getEncoding()
Pass the call on to the underlying handler
- Specified by:
- getEncoding in interface XSLOutputAttributes
- Overrides:
- getEncoding in interface SerializerBase
- See Also:
XSLOutputAttributes.getEncoding()
public boolean getIndent()
Pass the call on to the underlying handler
- Specified by:
- getIndent in interface XSLOutputAttributes
- Overrides:
- getIndent in interface SerializerBase
- See Also:
XSLOutputAttributes.getIndent()
public int getIndentAmount()
Pass the call on to the underlying handler
- Specified by:
- getIndentAmount in interface XSLOutputAttributes
- Overrides:
- getIndentAmount in interface SerializerBase
public String getMediaType()
Pass the call on to the underlying handler
- Specified by:
- getMediaType in interface XSLOutputAttributes
- Overrides:
- getMediaType in interface SerializerBase
- See Also:
XSLOutputAttributes.getMediaType()
public NamespaceMappings getNamespaceMappings()
Get the current namespace mappings. Simply returns the mappings of the wrapped handler.
- Specified by:
- getNamespaceMappings in interface ExtendedContentHandler
- Overrides:
- getNamespaceMappings in interface SerializerBase
public String getNamespaceURI(String qname, boolean isElement)
- Specified by:
- getNamespaceURI in interface ExtendedContentHandler
- Overrides:
- getNamespaceURI in interface SerializerBase
- See Also:
org.apache.xml.serializer.ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)
public String getNamespaceURIFromPrefix(String prefix)
Returns the URI of prefix (if any)
- Specified by:
- getNamespaceURIFromPrefix in interface ExtendedContentHandler
- Overrides:
- getNamespaceURIFromPrefix in interface SerializerBase
- Parameters:
prefix
- the prefix whose URI is searched for
- Returns:
- the namespace URI currently associated with the prefix, null if the prefix is undefined.
public boolean getOmitXMLDeclaration()
Pass the call on to the underlying handler
- Specified by:
- getOmitXMLDeclaration in interface XSLOutputAttributes
- Overrides:
- getOmitXMLDeclaration in interface SerializerBase
public Properties getOutputFormat()
- Specified by:
- getOutputFormat in interface Serializer
- Returns:
- the properties of the underlying handler
- See Also:
Serializer.getOutputFormat()
public OutputStream getOutputStream()
- Specified by:
- getOutputStream in interface Serializer
- Returns:
- the OutputStream of the underlying XML or HTML handler
- See Also:
Serializer.getOutputStream()
public String getPrefix(String namespaceURI)
- Specified by:
- getPrefix in interface ExtendedContentHandler
- Overrides:
- getPrefix in interface SerializerBase
public String getStandalone()
Pass the call on to the underlying handler
- Specified by:
- getStandalone in interface XSLOutputAttributes
- Overrides:
- getStandalone in interface SerializerBase
- See Also:
XSLOutputAttributes.getStandalone()
public Transformer getTransformer()
Gets the transformer associated with this serializer
- Specified by:
- getTransformer in interface SerializationHandler
- Overrides:
- getTransformer in interface SerializerBase
- Returns:
- returns the transformer associated with this serializer.
public String getVersion()
Pass the call on to the underlying handler
- Specified by:
- getVersion in interface XSLOutputAttributes
- Overrides:
- getVersion in interface SerializerBase
- See Also:
XSLOutputAttributes.getVersion()
public Writer getWriter()
- Specified by:
- getWriter in interface Serializer
- Returns:
- the Writer of the underlying XML or HTML handler
- See Also:
Serializer.getWriter()
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int)
public void internalEntityDecl(String arg0, String arg1) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.DeclHandler.internalEntityDecl(String, String)
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException
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:
- namespaceAfterStartElement in interface ExtendedContentHandler
- Overrides:
- namespaceAfterStartElement in interface SerializerBase
- Parameters:
prefix
- the prefix associated with the given URI.uri
- the URI of the namespace
public void processingInstruction(String target, String data) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.processingInstruction(String, String)
public boolean reset()
passes the call on to the underlying HTML or XML handler
- Specified by:
- reset in interface Serializer
- Overrides:
- reset in interface SerializerBase
- Returns:
- ???
- See Also:
Serializer.reset()
public void serialize(Node node) throws IOException
Converts the DOM node to output
- Specified by:
- serialize in interface SerializationHandler
- serialize in interface DOMSerializer
- Parameters:
node
- the DOM node to transform to output
- See Also:
DOMSerializer.serialize(Node)
public void setCdataSectionElements(Vector URI_and_localNames)
- Specified by:
- setCdataSectionElements in interface XSLOutputAttributes
- Parameters:
URI_and_localNames
- Vector a list of pairs of URI/localName specified in the cdata-section-elements attribute
- See Also:
org.apache.xml.serializer.SerializationHandler.setCdataSectionElements(java.util.Vector)
public void setContentHandler(ContentHandler ch)
- Specified by:
- setContentHandler in interface SerializationHandler
- See Also:
org.apache.xml.serializer.SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)
public void setDoctype(String system, String pub)
- Specified by:
- setDoctype in interface XSLOutputAttributes
- Overrides:
- setDoctype in interface SerializerBase
public void setDoctypePublic(String doctype)
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
- Specified by:
- setDoctypePublic in interface XSLOutputAttributes
- Overrides:
- setDoctypePublic in interface SerializerBase
- Parameters:
doctype
- the public doctype to set
public void setDoctypeSystem(String doctype)
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
- Specified by:
- setDoctypeSystem in interface XSLOutputAttributes
- Overrides:
- setDoctypeSystem in interface SerializerBase
- Parameters:
doctype
- the system doctype to set
public void setDocumentLocator(Locator locator)
Pass the call on to the underlying handler
- Overrides:
- setDocumentLocator in interface SerializerBase
- See Also:
org.xml.sax.ContentHandler.setDocumentLocator(Locator)
public void setEncoding(String encoding)
Pass the call on to the underlying handler
- Specified by:
- setEncoding in interface XSLOutputAttributes
- Overrides:
- setEncoding in interface SerializerBase
public boolean setEscaping(boolean escape) throws SAXException
- Specified by:
- setEscaping in interface SerializationHandler
public void setIndent(boolean indent)
Pass the call on to the underlying handler
- Specified by:
- setIndent in interface XSLOutputAttributes
- Overrides:
- setIndent in interface SerializerBase
public void setIndentAmount(int value)
Pass the call on to the underlying handler
- Specified by:
- setIndentAmount in interface SerializationHandler
- Overrides:
- setIndentAmount in interface SerializerBase
public void setMediaType(String mediaType)
- Specified by:
- setMediaType in interface XSLOutputAttributes
- Overrides:
- setMediaType in interface SerializerBase
public void setOmitXMLDeclaration(boolean b)
Pass the call on to the underlying handler
- Specified by:
- setOmitXMLDeclaration in interface XSLOutputAttributes
- Overrides:
- setOmitXMLDeclaration in interface SerializerBase
public void setOutputFormat(Properties format)
Set the properties of the handler
- Specified by:
- setOutputFormat in interface Serializer
- Parameters:
format
- the output properties to set
public void setOutputStream(OutputStream output)
Sets the output stream to write to
- Specified by:
- setOutputStream in interface Serializer
- Parameters:
output
- the OutputStream to write to
public void setSourceLocator(SourceLocator locator)
This method is used to set the source locator, which might be used to generated an error message.
- Specified by:
- setSourceLocator in interface ExtendedContentHandler
- Overrides:
- setSourceLocator in interface SerializerBase
- Parameters:
locator
- the source locator
- See Also:
org.apache.xml.serializer.ExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)
public void setStandalone(String standalone)
Pass the call on to the underlying handler
- Specified by:
- setStandalone in interface XSLOutputAttributes
- Overrides:
- setStandalone in interface SerializerBase
public void setTransformer(Transformer t)
Sets the transformer associated with this serializer
- Specified by:
- setTransformer in interface SerializationHandler
- Overrides:
- setTransformer in interface SerializerBase
- Parameters:
t
- the transformer associated with this serializer.
public void setVersion(String version)
This method cannot be cached because default is different in HTML and XML (we need more than a boolean).
- Specified by:
- setVersion in interface XSLOutputAttributes
- Overrides:
- setVersion in interface SerializerBase
public void setWriter(Writer writer)
Sets the writer to write to
- Specified by:
- setWriter in interface Serializer
- Parameters:
writer
- the writer to write to
- See Also:
Serializer.setWriter(Writer)
public void skippedEntity(String name) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ContentHandler.skippedEntity(String)
public void startCDATA() throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.startCDATA()
public void startDTD(String name, String publicId, String systemId) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.startDTD(String, String, String)
public void startDocument() throws SAXException
- Overrides:
- startDocument in interface SerializerBase
- See Also:
org.xml.sax.ContentHandler.startDocument()
public void startElement(String qName) throws SAXException
This method is used to notify of the start of an element
- Specified by:
- startElement in interface ExtendedContentHandler
- Parameters:
qName
- the fully qualified name of the element
public void startElement(String namespaceURI, String localName, String qName) throws SAXException
This 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.
- Specified by:
- startElement in interface ExtendedContentHandler
- Parameters:
localName
- the local name (without prefix) of the elementqName
- the qualified name of the element
public void startElement(String namespaceURI, String localName, String elementName, Attributes atts) throws SAXException
public void startEntity(String name) throws SAXException
Pass the call on to the underlying handler
- See Also:
org.xml.sax.ext.LexicalHandler.startEntity(String)
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Parameters:
prefix
- The prefix that maps to the URIuri
- The URI for the namespace
- See Also:
org.xml.sax.ContentHandler.startPrefixMapping(String, String)
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException
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.
- Specified by:
- startPrefixMapping in interface ExtendedContentHandler
- 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.