|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.xml.DocumentXMLSerializer
public class DocumentXMLSerializer
This class reprents a serializer of Document objects to XML output.
The output can eiter be a Writer, OutputStream, File or String by using one of the overloaded serialize methods.
By default the serializer is configured to use these settings:
| Constructor Summary | |
|---|---|
DocumentXMLSerializer()
Creates a document serializer. |
|
| Method Summary | |
|---|---|
Charset |
getEncoding()
Determines the encoding character set. |
boolean |
isIndenting()
Determines if indenting will be used when formatting the output. |
boolean |
isNamespaces()
Determines if namespaces are supported. |
boolean |
isPreserveSpace()
Determines if space is preserved. |
String |
serialize(Document document)
Serialized the document to a string. |
void |
serialize(File file,
Document document)
Serializes the document to a file. |
void |
serialize(OutputStream out,
Document document)
Serializes the document to an output stream. |
void |
serialize(Writer writer,
Document document)
Serialize the document to a writer. |
void |
setEncoding(Charset encoding)
Sets the encoding character set. |
void |
setIndenting(boolean indenting)
Setting this to true will cause indenting to be used when formatting the output. |
void |
setNamespaces(boolean namespaces)
Sets the namespace support |
void |
setPreserveSpace(boolean preserveSpace)
Setting this to true will make space be preserved. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DocumentXMLSerializer()
| Method Detail |
|---|
public Charset getEncoding()
IDocumentXMLSerializer
getEncoding in interface IDocumentXMLSerializerpublic void setEncoding(Charset encoding)
IDocumentXMLSerializer
setEncoding in interface IDocumentXMLSerializerencoding - character setpublic boolean isPreserveSpace()
IDocumentXMLSerializer
isPreserveSpace in interface IDocumentXMLSerializerpublic void setPreserveSpace(boolean preserveSpace)
IDocumentXMLSerializer
setPreserveSpace in interface IDocumentXMLSerializerpreserveSpace - preserve space valuepublic boolean isNamespaces()
IDocumentXMLSerializer
isNamespaces in interface IDocumentXMLSerializerpublic void setNamespaces(boolean namespaces)
IDocumentXMLSerializer
setNamespaces in interface IDocumentXMLSerializernamespaces - new namespaces support valuepublic boolean isIndenting()
IDocumentXMLSerializer
isIndenting in interface IDocumentXMLSerializerpublic void setIndenting(boolean indenting)
IDocumentXMLSerializer
setIndenting in interface IDocumentXMLSerializerindenting - indenting value
public void serialize(Writer writer,
Document document)
throws IOException
IDocumentXMLSerializer
serialize in interface IDocumentXMLSerializerwriter - writerdocument - document
IOException - if an I/O error occurs
public void serialize(OutputStream out,
Document document)
throws IOException
IDocumentXMLSerializer
serialize in interface IDocumentXMLSerializerout - output streamdocument - document
IOException - if an I/O error occurs
public void serialize(File file,
Document document)
throws IOException
IDocumentXMLSerializer
serialize in interface IDocumentXMLSerializerfile - filedocument - document
IOException - if an I/O error occurs
public String serialize(Document document)
throws IOException
IDocumentXMLSerializer
serialize in interface IDocumentXMLSerializerdocument - document
IOException - if an I/O error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||