| java.lang.Object |
| ↳ |
com.sforce.ws.parser.MXSerializer |
Class Overview
Implementation of XmlSerializer interface from XmlPull V1 API.
This implementation is optimzied 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
Summary
| Public Methods |
|
MXSerializer
|
attribute(String namespace, String name, String value)
|
|
void
|
cdsect(String text)
|
|
void
|
comment(String text)
|
|
void
|
docdecl(String text)
|
|
void
|
endDocument()
|
|
MXSerializer
|
endTag(String namespace, String name)
|
|
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)
|
|
void
|
processingInstruction(String text)
|
|
void
|
setFeature(String name, boolean state)
|
|
void
|
setOutput(Writer writer)
|
|
void
|
setOutput(OutputStream os, String encoding)
|
|
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)
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
protected
static
final
String
PROPERTY_LOCATION
Constant Value:
"http://xmlpull.org/v1/doc/properties.html#location"
private
static
final
boolean
TRACE_ESCAPING
private
static
final
boolean
TRACE_SIZING
protected
static
final
String
XMLNS_URI
Constant Value:
"http://www.w3.org/2000/xmlns/"
protected
static
final
String
XML_URI
Constant Value:
"http://www.w3.org/XML/1998/namespace"
Fields
private
static
final
int
BUF_LEN
protected
final
String
FEATURE_NAMES_INTERNED
Constant Value:
"http://xmlpull.org/v1/doc/features.html#names-interned"
protected
final
String
FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE
Constant Value:
"http://xmlpull.org/v1/doc/features.html#serializer-attvalue-use-apostrophe"
protected
final
String
PROPERTY_SERIALIZER_INDENTATION
Constant Value:
"http://xmlpull.org/v1/doc/properties.html#serializer-indentation"
protected
final
String
PROPERTY_SERIALIZER_LINE_SEPARATOR
Constant Value:
"http://xmlpull.org/v1/doc/properties.html#serializer-line-separator"
protected
boolean
attributeUseApostrophe
protected
int
autoDeclaredPrefixes
private
boolean
checkNamesInterned
protected
boolean
doIndent
protected
String[]
elName
protected
String[]
elNamespace
protected
int[]
elNamespaceCount
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
boolean
pastRoot
protected
static
final
String[]
precomputedPrefixes
protected
boolean
seenBracket
protected
boolean
seenBracketBracket
protected
boolean
seenTag
protected
boolean
setPrefixCalled
protected
boolean
startTagIncomplete
protected
boolean
writeIndentation
protected
boolean
writeLineSepartor
Public Constructors
Public Methods
public
MXSerializer
attribute
(String namespace, String name, String value)
public
void
cdsect
(String text)
public
void
comment
(String text)
public
void
docdecl
(String text)
public
void
endDocument
()
public
void
entityRef
(String text)
public
boolean
getFeature
(String name)
public
String
getNamespace
()
public
String
getPrefix
(String namespace, boolean generatePrefix)
public
Object
getProperty
(String name)
public
Writer
getWriter
()
public
void
ignorableWhitespace
(String text)
public
void
processingInstruction
(String text)
public
void
setFeature
(String name, boolean state)
Throws
| IllegalArgumentException
| |
| IllegalStateException
| |
public
void
setOutput
(Writer writer)
public
void
setOutput
(OutputStream os, String encoding)
public
void
setPrefix
(String prefix, String namespace)
public
void
setProperty
(String name, Object value)
Throws
| IllegalArgumentException
| |
| IllegalStateException
| |
public
void
startDocument
(String encoding, Boolean standalone)
public
MXSerializer
startTag
(String namespace, String name)
Protected Methods
protected
void
closeStartTag
()
protected
void
ensureElementsCapacity
()
protected
void
ensureNamespacesCapacity
()
protected
String
lookupOrDeclarePrefix
(String namespace)
protected
static
String
printable
(char ch)
protected
static
String
printable
(String s)
simple utility method -- good for debugging
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
writeAttributeValue
(String value, Writer out)
protected
void
writeElementContent
(String text, Writer out)
protected
void
writeElementContent
(char[] buf, int off, int len, Writer out)
protected
void
writeIndent
()