Package org.xmlpull.v1.wrapper
Interface XmlSerializerWrapper
-
- All Superinterfaces:
XmlSerializer
- All Known Implementing Classes:
StaticXmlSerializerWrapper
public interface XmlSerializerWrapper extends XmlSerializer
Extensions to XmlSerialzier interface- Author:
- Aleksander Slominski, Naresh Bhatia
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XmlSerializerWrapperattribute(String name, String value)Write an attribute without namespace.XmlSerializerWrapperelement(String elementName, String elementText)Write simple text element in current namespaceXmlSerializerWrapperelement(String namespace, String elementName, String elementText)Writes a simple element such as <username>johndoe</username>.XmlSerializerWrapperendTag(String name)Write end tag in current namespace with name given as argument.StringescapeAttributeValue(String text)StringescapeText(String text)voidevent(XmlPullParser pp)Serializer current event form pull parservoidfragment(String xmlFragment)Write XML fragment using currently set namespace prefixesStringgetCurrentNamespaceForElements()Get namespace that is used as default when no namespace parameter is used for startTag(), endTag() and element()StringsetCurrentNamespaceForElements(String value)Set namespace to use in startTag(), endTag() and element() when methods called are those without namespace parameter.XmlSerializerWrapperstartTag(String name)Write start tag in current namespace with name given as argument.-
Methods inherited from interface org.xmlpull.v1.XmlSerializer
attribute, cdsect, comment, docdecl, endDocument, endTag, entityRef, flush, getDepth, getFeature, getName, getNamespace, getPrefix, getProperty, ignorableWhitespace, processingInstruction, setFeature, setOutput, setOutput, setPrefix, setProperty, startDocument, startTag, text, text
-
-
-
-
Field Detail
-
NO_NAMESPACE
static final String NO_NAMESPACE
- See Also:
- Constant Field Values
-
XSI_NS
static final String XSI_NS
- See Also:
- Constant Field Values
-
XSD_NS
static final String XSD_NS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCurrentNamespaceForElements
String getCurrentNamespaceForElements()
Get namespace that is used as default when no namespace parameter is used for startTag(), endTag() and element()
-
setCurrentNamespaceForElements
String setCurrentNamespaceForElements(String value)
Set namespace to use in startTag(), endTag() and element() when methods called are those without namespace parameter.
-
attribute
XmlSerializerWrapper attribute(String name, String value) throws IOException, IllegalArgumentException, IllegalStateException
Write an attribute without namespace. Calls to attribute() MUST follow a call to startTag() immediately. If there is no prefix defined for the given namespace, a prefix will be defined automatically. NOTE: current element namespace is not used attribute and attributre has no namespace.
-
startTag
XmlSerializerWrapper startTag(String name) throws IOException, IllegalArgumentException, IllegalStateException
Write start tag in current namespace with name given as argument.
-
endTag
XmlSerializerWrapper endTag(String name) throws IOException, IllegalArgumentException, IllegalStateException
Write end tag in current namespace with name given as argument.
-
element
XmlSerializerWrapper element(String namespace, String elementName, String elementText) throws IOException, XmlPullParserException
Writes a simple element such as <username>johndoe</username>. The namespace and elementText are allowed to be null. If elementText is null, an xsi:nil="true" will be added as an attribute.- Throws:
IOExceptionXmlPullParserException
-
element
XmlSerializerWrapper element(String elementName, String elementText) throws IOException, XmlPullParserException
Write simple text element in current namespace- Throws:
IOExceptionXmlPullParserException
-
fragment
void fragment(String xmlFragment) throws IOException, IllegalArgumentException, IllegalStateException, XmlPullParserException
Write XML fragment using currently set namespace prefixes
-
event
void event(XmlPullParser pp) throws IOException, IllegalArgumentException, IllegalStateException, XmlPullParserException
Serializer current event form pull parser
-
escapeText
String escapeText(String text) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
escapeAttributeValue
String escapeAttributeValue(String text) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-