Package org.xmlpull.renamed
Class MXSerializer
java.lang.Object
org.xmlpull.renamed.MXSerializer
- All Implemented Interfaces:
org.xmlpull.v1.XmlSerializer
- Direct Known Subclasses:
ExtMXSerializer
Implementation of XmlSerializer interface from XmlPull V1 API. This
implementation is optimized for performance and low memory footprint.
Implemented features:
- FEATURE_NAMES_INTERNED - when enabled all returned names (namespaces, prefixes) will be interned and it is required that all names passed as arguments MUST be interned
- FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE
Implemented properties:
- PROPERTY_SERIALIZER_INDENTATION
- PROPERTY_SERIALIZER_LINE_SEPARATOR
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected char[]protected intprotected booleanprotected String[]protected String[]protected int[]protected String[]protected final Stringprotected final Stringprotected booleanprotected char[]protected intprotected Stringprotected Stringprotected Stringprotected intprotected booleanprotected intprotected String[]protected String[]protected intprotected Writerprotected booleanprotected static final String[]protected static final Stringprotected final Stringprotected final Stringprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.xmlpull.v1.XmlSerializervoidprotected voidvoidvoidvoidorg.xmlpull.v1.XmlSerializerprotected voidprotected voidvoidvoidflush()intgetDepth()booleangetFeature(String name) getName()protected StringgetProperty(String name) voidignorableWhitespace(String text) protected StringlookupOrDeclarePrefix(String namespace) protected static Stringprintable(char ch) protected static StringvoidprocessingInstruction(String text) protected voidFor maximum efficiency when writing indents the required output is pre-computed This is internal function that recomputes buffer after user requested chnages.protected voidreset()voidsetFeature(String name, boolean state) voidsetOutput(OutputStream os, String encoding) voidvoidvoidsetProperty(String name, Object value) voidstartDocument(String encoding, Boolean standalone) org.xmlpull.v1.XmlSerializerorg.xmlpull.v1.XmlSerializertext(char[] buf, int start, int len) org.xmlpull.v1.XmlSerializerprotected voidwriteAttributeValue(String value, Writer out) protected voidwriteElementContent(char[] buf, int off, int len, Writer out) protected voidwriteElementContent(String text, Writer out) protected voidprotected void
-
Field Details
-
XML_URI
- See Also:
-
XMLNS_URI
- See Also:
-
FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE
- See Also:
-
FEATURE_NAMES_INTERNED
- See Also:
-
PROPERTY_SERIALIZER_INDENTATION
- See Also:
-
PROPERTY_SERIALIZER_LINE_SEPARATOR
- See Also:
-
PROPERTY_LOCATION
- See Also:
-
namesInterned
protected boolean namesInterned -
attributeUseApostrophe
protected boolean attributeUseApostrophe -
indentationString
-
lineSeparator
-
location
-
out
-
autoDeclaredPrefixes
protected int autoDeclaredPrefixes -
depth
protected int depth -
elNamespace
-
elName
-
elPrefix
-
elNamespaceCount
protected int[] elNamespaceCount -
namespaceEnd
protected int namespaceEnd -
namespacePrefix
-
namespaceUri
-
finished
protected boolean finished -
pastRoot
protected boolean pastRoot -
setPrefixCalled
protected boolean setPrefixCalled -
startTagIncomplete
protected boolean startTagIncomplete -
doIndent
protected boolean doIndent -
seenTag
protected boolean seenTag -
seenBracket
protected boolean seenBracket -
seenBracketBracket
protected boolean seenBracketBracket -
buf
protected char[] buf -
precomputedPrefixes
-
offsetNewLine
protected int offsetNewLine -
indentationJump
protected int indentationJump -
indentationBuf
protected char[] indentationBuf -
maxIndentLevel
protected int maxIndentLevel -
writeLineSepartor
protected boolean writeLineSepartor -
writeIndentation
protected boolean writeIndentation
-
-
Constructor Details
-
MXSerializer
public MXSerializer()
-
-
Method Details
-
reset
protected void reset() -
ensureElementsCapacity
protected void ensureElementsCapacity() -
ensureNamespacesCapacity
protected void ensureNamespacesCapacity() -
setFeature
public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException - Specified by:
setFeaturein interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IllegalArgumentExceptionIllegalStateException
-
getFeature
- Specified by:
getFeaturein interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IllegalArgumentException
-
rebuildIndentationBuf
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. -
writeIndent
- Throws:
IOException
-
setProperty
public void setProperty(String name, Object value) throws IllegalArgumentException, IllegalStateException - Specified by:
setPropertyin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IllegalArgumentExceptionIllegalStateException
-
getProperty
- Specified by:
getPropertyin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IllegalArgumentException
-
getWriter
-
setOutput
- Specified by:
setOutputin interfaceorg.xmlpull.v1.XmlSerializer
-
setOutput
- Specified by:
setOutputin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
startDocument
- Specified by:
startDocumentin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
endDocument
- Specified by:
endDocumentin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
setPrefix
- Specified by:
setPrefixin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
lookupOrDeclarePrefix
-
getPrefix
- Specified by:
getPrefixin interfaceorg.xmlpull.v1.XmlSerializer
-
getPrefix
-
getDepth
public int getDepth()- Specified by:
getDepthin interfaceorg.xmlpull.v1.XmlSerializer
-
getNamespace
- Specified by:
getNamespacein interfaceorg.xmlpull.v1.XmlSerializer
-
getName
- Specified by:
getNamein interfaceorg.xmlpull.v1.XmlSerializer
-
startTag
- Specified by:
startTagin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
attribute
public org.xmlpull.v1.XmlSerializer attribute(String namespace, String name, String value) throws IOException - Specified by:
attributein interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
closeStartTag
- Throws:
IOException
-
writeNamespaceDeclarations
- Throws:
IOException
-
endTag
- Specified by:
endTagin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
text
- Specified by:
textin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
text
- Specified by:
textin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
cdsect
- Specified by:
cdsectin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
entityRef
- Specified by:
entityRefin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
processingInstruction
- Specified by:
processingInstructionin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
comment
- Specified by:
commentin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
docdecl
- Specified by:
docdeclin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
flush
- Specified by:
flushin interfaceorg.xmlpull.v1.XmlSerializer- Throws:
IOException
-
writeAttributeValue
- Throws:
IOException
-
writeElementContent
- Throws:
IOException
-
writeElementContent
- Throws:
IOException
-
printable
-
printable
-