|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sapportals.wcm.util.xml.SimpleSerializer
Simple DOM serializer. Only supports UTF-8 encoding and simple indentation (whitespace preservation not implemented - if whitespace preservation is required simply do not indent).
Copyright (c) SAP AG 2001-2004
| Field Summary | |
static java.lang.String |
NS_XML
Namespace name for the namespace hardwired to the prefix "xml:" |
static java.lang.String |
NS_XMLNS
Namespace name for the namespace hardwired to the prefix "xmlns:" |
| Constructor Summary | |
SimpleSerializer(java.io.Writer writer,
java.lang.String indent)
Construct a new Serializer |
|
| Method Summary | |
void |
closeElement()
Closes the currently open element. |
static java.lang.String |
escape(java.lang.String s,
boolean escapeQuoteChar)
Escape characters in a string for inclusion into XML text content. |
SimpleSerializer |
openElement(org.w3c.dom.Element element)
Serializes the open tag of the specified element and returns a new SimpleSerializer object for use in serializing any child elements (and writing the closing tag). |
void |
serialize(org.w3c.dom.Node n)
Serialize a node and it's children. |
void |
setNsAware(boolean nsAware)
Set to false to switch off namespace processing (enabling
strict DOM level 1 serialization) |
void |
setOptimizeNSDeclarations(boolean doOptimize)
|
static java.lang.String |
toString(org.w3c.dom.Document doc,
boolean indent)
Serialize the document to a string. |
static java.lang.String |
toString(org.w3c.dom.Document doc,
boolean indent,
boolean doNsProcessing)
Serialize the document to a string. |
static java.lang.String |
toString(org.w3c.dom.Node n,
boolean indent)
Serialize the element (and it's children) to a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String NS_XML
public static final java.lang.String NS_XMLNS
| Constructor Detail |
public SimpleSerializer(java.io.Writer writer,
java.lang.String indent)
writer - outputindent - indentation string| Method Detail |
public static java.lang.String toString(org.w3c.dom.Document doc,
boolean indent)
doc - the documentindent - whether to produce indented XML or not
public static java.lang.String toString(org.w3c.dom.Document doc,
boolean indent,
boolean doNsProcessing)
doc - the documentindent - whether to produce indented XML or notdoNsProcessing - enable/disable special namespace support in the
serializer
public static java.lang.String toString(org.w3c.dom.Node n,
boolean indent)
throws java.lang.IllegalArgumentException
indent - whether to produce indented XML or notn - node to serializejava.lang.IllegalArgumentException - when node is a AttributeNodepublic void setNsAware(boolean nsAware)
false to switch off namespace processing (enabling
strict DOM level 1 serialization)nsAware - flagpublic void setOptimizeNSDeclarations(boolean doOptimize)
public SimpleSerializer openElement(org.w3c.dom.Element element)
throws java.io.IOException
element - Element for which the start tag shall be writtenjava.io.IOException - Exception raised in failure situation
public void closeElement()
throws java.io.IOException
java.io.IOException - Exception raised in failure situation
public static java.lang.String escape(java.lang.String s,
boolean escapeQuoteChar)
throws java.io.IOException
s - un-escaped stringescapeQuoteChar - whether to escape the quote character or not (for
attribute values). Note that attributes are supposed to be quoted
using double quotes, so apostroph characters are not
replaced.java.io.IOException - when quoting not possible
public void serialize(org.w3c.dom.Node n)
throws java.io.IOException
n - start nodejava.io.IOException - Exception raised in failure situation
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||