| java.lang.Object org.xml.sax.helpers.DefaultHandler org.opencms.util.CmsXmlSaxWriter
CmsXmlSaxWriter | public class CmsXmlSaxWriter extends DefaultHandler implements LexicalHandler(Code) | | Simple SAX event handler that generates a XML (or HTML) file from the events caught.
This can be used for writing large XML files where keeping a DOM structure
in memory might cause out-of-memory issues, like e.g. when writing the
OpenCms export files.
It can also be used if a
org.xml.sax.ContentHandler is needed that should
generate a XML / HTML file from a series of SAX events.
author: Alexander Kandzior version: $Revision: 1.16 $ since: 6.0.0 |
Method Summary | |
public void | characters(char[] buf, int offset, int len) | public void | comment(char[] ch, int start, int length) | public void | endCDATA() | public void | endDTD() | public void | endDocument() | public void | endElement(String namespaceURI, String localName, String qualifiedName) | public void | endEntity(String name) | public String | getEncoding() | public Writer | getWriter() | public boolean | isEscapeUnknownChars() | public boolean | isEscapeXml() | public void | setEncoding(String value) | public void | setEscapeUnknownChars(boolean value) | public void | setEscapeXml(boolean value) | public void | startCDATA() | public void | startDTD(String name, String publicId, String systemId) | public void | startDocument() | public void | startElement(String namespaceURI, String localName, String qualifiedName, Attributes attributes) | public void | startEntity(String name) |
CmsXmlSaxWriter | public CmsXmlSaxWriter()(Code) | | Creates a SAX event handler that generates XML / HTML Strings from the events caught
using a new
StringWriter and the OpenCms default encoding.
|
CmsXmlSaxWriter | public CmsXmlSaxWriter(String encoding)(Code) | | Creates a SAX event handler that generates XML / HTML Strings from the events caught
using a new
StringWriter and the given encoding.
Parameters: encoding - the encoding for the XML file |
CmsXmlSaxWriter | public CmsXmlSaxWriter(Writer writer)(Code) | | Creates a SAX event handler that generates XML / HTML Strings from the events caught
using a new
StringWriter and the given encoding.
Parameters: writer - the Writer to write to output to |
CmsXmlSaxWriter | public CmsXmlSaxWriter(Writer writer, String encoding)(Code) | | A SAX event handler that generates XML / HTML Strings from the events caught and writes them
to the given Writer.
Parameters: writer - the Writer to write to output to Parameters: encoding - the encoding for the XML file |
getEncoding | public String getEncoding()(Code) | | Returns the encoding this XML Sax writer was initialized with.
the encoding this XML Sax writer was initialized with |
getWriter | public Writer getWriter()(Code) | | Returns the Writer where the XML is written to.
the Writer where the XML is written to |
isEscapeUnknownChars | public boolean isEscapeUnknownChars()(Code) | | Returns true if charactes that are not part of the selected encoding
are to be replaced with the HTML { entity representation
in the generated output (not in CDATA elements).
true if charactes that are not part of the selected encoding are to be replaced with the HTML entity representation |
isEscapeXml | public boolean isEscapeXml()(Code) | | Returns true if XML entities are to be encoded in the generated output (not in CDATA elements).
true if XML entities are to be encoded in the generated output (not in CDATA elements) |
setEncoding | public void setEncoding(String value)(Code) | | Sets the encoding to use for the generated output.
Parameters: value - the encoding to use for the generated output |
setEscapeUnknownChars | public void setEscapeUnknownChars(boolean value)(Code) | | If set to true , then charactes that are not part of the selected encoding
are to be replaced with the XML { entity representation
in the generated output (not in CDATA elements).
Parameters: value - indicates to escape unknown characters with XML entities or not |
setEscapeXml | public void setEscapeXml(boolean value)(Code) | | If set to true , then
XML entities are to be encoded in the generated output (not in CDATA elements).
Parameters: value - indicates to to escape characters with XML entities or not |
Methods inherited from org.xml.sax.helpers.DefaultHandler | public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc) public void error(SAXParseException e) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc) public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)
|
|
|