public class MXSerializer extends Object
Implemented features:
Implemented properties:
Modifier and Type | Field and Description |
---|---|
protected boolean |
attributeUseApostrophe |
protected int |
autoDeclaredPrefixes |
protected char[] |
buf |
protected int |
depth |
protected boolean |
doIndent |
protected String[] |
elName |
protected String[] |
elNamespace |
protected int[] |
elNamespaceCount |
protected String |
FEATURE_NAMES_INTERNED |
protected String |
FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE |
protected boolean |
finished |
protected char[] |
indentationBuf |
protected int |
indentationJump |
protected String |
indentationString |
protected String |
lineSeparator |
protected String |
location |
protected int |
maxIndentLevel |
protected boolean |
namesInterned |
protected int |
namespaceEnd |
protected String[] |
namespacePrefix |
protected String[] |
namespaceUri |
protected int |
offsetNewLine |
protected Writer |
out |
protected boolean |
pastRoot |
protected static String[] |
precomputedPrefixes |
protected static String |
PROPERTY_LOCATION |
protected String |
PROPERTY_SERIALIZER_INDENTATION |
protected String |
PROPERTY_SERIALIZER_LINE_SEPARATOR |
protected boolean |
seenBracket |
protected boolean |
seenBracketBracket |
protected boolean |
seenTag |
protected boolean |
setPrefixCalled |
protected boolean |
startTagIncomplete |
protected boolean |
writeIndentation |
protected boolean |
writeLineSepartor |
protected static String |
XML_URI |
protected static String |
XMLNS_URI |
Constructor and Description |
---|
MXSerializer() |
Modifier and Type | Method and Description |
---|---|
MXSerializer |
attribute(String namespace,
String name,
String value) |
void |
cdsect(String text) |
protected void |
closeStartTag() |
void |
comment(String text) |
void |
docdecl(String text) |
void |
endDocument() |
MXSerializer |
endTag(String namespace,
String name) |
protected void |
ensureElementsCapacity() |
protected void |
ensureNamespacesCapacity() |
void |
entityRef(String text) |
void |
flush() |
int |
getDepth() |
boolean |
getFeature(String name) |
String |
getName() |
String |
getNamespace() |
String |
getPrefix(String namespace,
boolean generatePrefix) |
Object |
getProperty(String name) |
Writer |
getWriter() |
void |
ignorableWhitespace(String text) |
protected String |
lookupOrDeclarePrefix(String namespace) |
protected static String |
printable(char ch) |
protected static String |
printable(String s)
simple utility method -- good for debugging
|
void |
processingInstruction(String text) |
protected void |
rebuildIndentationBuf()
For maximum efficiency when writing indents the required output is pre-computed
This is internal function that recomputes buffer after user requested chnages.
|
protected void |
reset() |
void |
setFeature(String name,
boolean state) |
void |
setOutput(OutputStream os,
String encoding) |
void |
setOutput(Writer writer) |
void |
setPrefix(String prefix,
String namespace) |
void |
setProperty(String name,
Object value) |
void |
startDocument(String encoding,
Boolean standalone) |
MXSerializer |
startTag(String namespace,
String name) |
MXSerializer |
text(char[] buf,
int start,
int len) |
MXSerializer |
text(String text) |
protected void |
writeAttributeValue(String value,
Writer out) |
protected void |
writeElementContent(char[] buf,
int off,
int len,
Writer out) |
protected void |
writeElementContent(String text,
Writer out) |
protected void |
writeIndent() |
protected static final String XML_URI
protected static final String XMLNS_URI
protected final String FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE
protected final String FEATURE_NAMES_INTERNED
protected final String PROPERTY_SERIALIZER_INDENTATION
protected final String PROPERTY_SERIALIZER_LINE_SEPARATOR
protected static final String PROPERTY_LOCATION
protected boolean namesInterned
protected boolean attributeUseApostrophe
protected String indentationString
protected String lineSeparator
protected String location
protected Writer out
protected int autoDeclaredPrefixes
protected int depth
protected String[] elNamespace
protected String[] elName
protected int[] elNamespaceCount
protected int namespaceEnd
protected String[] namespacePrefix
protected String[] namespaceUri
protected boolean finished
protected boolean pastRoot
protected boolean setPrefixCalled
protected boolean startTagIncomplete
protected boolean doIndent
protected boolean seenTag
protected boolean seenBracket
protected boolean seenBracketBracket
protected char[] buf
protected static final String[] precomputedPrefixes
protected int offsetNewLine
protected int indentationJump
protected char[] indentationBuf
protected int maxIndentLevel
protected boolean writeLineSepartor
protected boolean writeIndentation
protected void reset()
protected void ensureElementsCapacity()
protected void ensureNamespacesCapacity()
public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException
public boolean getFeature(String name) throws IllegalArgumentException
IllegalArgumentException
protected void rebuildIndentationBuf()
protected void writeIndent() throws IOException
IOException
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException
public Object getProperty(String name) throws IllegalArgumentException
IllegalArgumentException
public Writer getWriter()
public void setOutput(Writer writer)
public void setOutput(OutputStream os, String encoding) throws IOException
IOException
public void startDocument(String encoding, Boolean standalone) throws IOException
IOException
public void endDocument() throws IOException
IOException
public void setPrefix(String prefix, String namespace) throws IOException
IOException
public int getDepth()
public String getNamespace()
public String getName()
public MXSerializer startTag(String namespace, String name) throws IOException
IOException
public MXSerializer attribute(String namespace, String name, String value) throws IOException
IOException
protected void closeStartTag() throws IOException
IOException
public MXSerializer endTag(String namespace, String name) throws IOException
IOException
public MXSerializer text(String text) throws IOException
IOException
public MXSerializer text(char[] buf, int start, int len) throws IOException
IOException
public void cdsect(String text) throws IOException
IOException
public void entityRef(String text) throws IOException
IOException
public void processingInstruction(String text) throws IOException
IOException
public void comment(String text) throws IOException
IOException
public void docdecl(String text) throws IOException
IOException
public void ignorableWhitespace(String text) throws IOException
IOException
public void flush() throws IOException
IOException
protected void writeAttributeValue(String value, Writer out) throws IOException
IOException
protected void writeElementContent(String text, Writer out) throws IOException
IOException
protected void writeElementContent(char[] buf, int off, int len, Writer out) throws IOException
IOException
protected static String printable(char ch)
Copyright © 2016. All Rights Reserved.