|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.opencms.util.CmsXmlSaxWriter
public class CmsXmlSaxWriter
Simple SAX event handler that generates a XML file from the events caught.
This is to 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.
| Constructor Summary | |
|---|---|
CmsXmlSaxWriter(Writer writer,
String encoding)
A SAX event handler that generates XML Strings from the events caught and writes them to the given Writer. |
|
| Method Summary | |
|---|---|
void |
characters(char[] buf,
int offset,
int len)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String namespaceURI,
String localName,
String qualifiedName)
|
void |
endEntity(String name)
|
Writer |
getWriter()
Returns the Writer where the XML is written to. |
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String namespaceURI,
String localName,
String qualifiedName,
Attributes attributes)
|
void |
startEntity(String name)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CmsXmlSaxWriter(Writer writer,
String encoding)
writer - the Writer to write to output toencoding - the encoding for the XML output file header| Method Detail |
|---|
public void characters(char[] buf,
int offset,
int len)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionContentHandler.characters(char[], int, int)
public void comment(char[] ch,
int start,
int length)
comment in interface LexicalHandlerLexicalHandler.comment(char[], int, int)
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionLexicalHandler.endCDATA()
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionContentHandler.endDocument()public void endDTD()
endDTD in interface LexicalHandlerLexicalHandler.endDTD()
public void endElement(String namespaceURI,
String localName,
String qualifiedName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)public void endEntity(String name)
endEntity in interface LexicalHandlerLexicalHandler.endEntity(java.lang.String)public Writer getWriter()
public void startCDATA()
startCDATA in interface LexicalHandlerLexicalHandler.startCDATA()
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXExceptionContentHandler.startDocument()
public void startDTD(String name,
String publicId,
String systemId)
startDTD in interface LexicalHandlerLexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void startElement(String namespaceURI,
String localName,
String qualifiedName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)public void startEntity(String name)
startEntity in interface LexicalHandlerLexicalHandler.startEntity(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||