public class XMLStreamHelper
extends java.lang.Object
Constructor and Description |
---|
XMLStreamHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
assertEmptyElement(org.xmlpull.v1.XmlPullParser reader)
Throw an exception if the current element contains a child element
or character data.
|
static void |
assertEvent(org.xmlpull.v1.XmlPullParser reader,
int event)
Check that the current event is of the given type.
|
static void |
assertStartElement(org.xmlpull.v1.XmlPullParser reader,
java.lang.String elemNamespaceURI,
java.lang.String elemName)
Check that the current event is a START_ELEMENT for the given element.
|
static void |
beginDocumentDecode(org.xmlpull.v1.XmlPullParser reader)
Begin document decoding by skipping all input up to the first start
element.
|
static boolean |
checkEmptyElement(org.xmlpull.v1.XmlPullParser reader)
This is a placeholder method that's needed for generated C# code, but
not for generated Java code.
|
static void |
decodeNamespaces(org.xmlpull.v1.XmlPullParser reader,
XBComplexType obj)
Decode the namespaces on the current start event into the given object.
|
static void |
decodeSchemaLocations(org.xmlpull.v1.XmlPullParser reader,
XBContext obj)
Decode the xsi:schemaLocation and xsi:noSchemaLocation attributes
into the given XBContext object.
|
static boolean |
isElementNilled(org.xmlpull.v1.XmlPullParser reader)
Return true if the current element has a nil attribute set to "true".
|
static boolean |
isEndContent(org.xmlpull.v1.XmlPullParser reader)
Returns TRUE if the reader is at an END_TAG or END_DOCUMENT.
|
static boolean |
moveToContentElement(org.xmlpull.v1.XmlPullParser reader)
This tries to locate the next content element, ie, the next element at
the current level.
|
static java.lang.String |
nameForEvent(int event) |
static int |
nextTagOrEndDocument(org.xmlpull.v1.XmlPullParser reader)
Skip comments, processing instructions, and whitespace until the
next START_ELEMENT, END_ELEMENT, or END_DOCUMENT is found.
|
static java.lang.String |
readContent(org.xmlpull.v1.XmlPullParser reader)
Read content for the current element into a raw XML string.
|
static java.lang.String |
readElementAndContent(org.xmlpull.v1.XmlPullParser reader)
Read the current element and all of its content into a String.
|
static javax.xml.namespace.QName |
readXsiType(org.xmlpull.v1.XmlPullParser reader)
Return the QName (or null) for the xsi:type attribute.
|
static void |
skipToEndElement(org.xmlpull.v1.XmlPullParser reader)
Skip all events until an end element is found that closes
the start element under which the current event is nested.
|
public static void assertEmptyElement(org.xmlpull.v1.XmlPullParser reader)
public static void assertEvent(org.xmlpull.v1.XmlPullParser reader, int event) throws XBException
reader
- XBException
public static void assertStartElement(org.xmlpull.v1.XmlPullParser reader, java.lang.String elemNamespaceURI, java.lang.String elemName) throws XBException
reader
- elemNamespaceURI
- namespace URI of elementelemName
- short name for elementXBException
public static void beginDocumentDecode(org.xmlpull.v1.XmlPullParser reader) throws XBException
reader
- XBException
public static void decodeNamespaces(org.xmlpull.v1.XmlPullParser reader, XBComplexType obj)
reader
- public static void decodeSchemaLocations(org.xmlpull.v1.XmlPullParser reader, XBContext obj)
reader
- Should be on START_ELEMENT event.obj
- public static java.lang.String nameForEvent(int event)
public static boolean isElementNilled(org.xmlpull.v1.XmlPullParser reader)
reader
- public static boolean isEndContent(org.xmlpull.v1.XmlPullParser reader)
public static boolean moveToContentElement(org.xmlpull.v1.XmlPullParser reader) throws org.xmlpull.v1.XmlPullParserException
reader
- XBException
org.xmlpull.v1.XmlPullParserException
public static int nextTagOrEndDocument(org.xmlpull.v1.XmlPullParser reader) throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException
public static java.lang.String readContent(org.xmlpull.v1.XmlPullParser reader) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
reader
- The reader to read from.org.xmlpull.v1.XmlPullParserException
java.io.IOException
public static java.lang.String readElementAndContent(org.xmlpull.v1.XmlPullParser reader) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
reader
- The reader to read from. Current event must be
START_ELEMENTorg.xmlpull.v1.XmlPullParserException
java.io.IOException
public static javax.xml.namespace.QName readXsiType(org.xmlpull.v1.XmlPullParser reader)
public static void skipToEndElement(org.xmlpull.v1.XmlPullParser reader) throws XBException
reader
- XBException
public static boolean checkEmptyElement(org.xmlpull.v1.XmlPullParser reader)
reader
- the reader instance