javax.xml.stream.XMLStreamReader interface that wraps a
XMLEventReader. Useful because the StAX javax.xml.stream.XMLInputFactory
allows one to create an event reader from a stream reader, but not vice-versa.
StaxUtils#createEventStreamReader(javax.xml.stream.XMLEventReader)
| Modifier and Type | Field and Description |
|---|---|
| private XMLEvent | |
| private final XMLEventReader |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements javax. |
| private static int | |
| private Attribute | |
| public int | getAttributeCount()
Implements javax. |
| public QName | getAttributeName(int
the position of the attribute index)Implements javax. |
| public String | getAttributeType(int
the position of the attribute index)Implements javax. |
| public String | getAttributeValue(int
the position of the attribute index)Implements javax. |
| public String | getCharacterEncodingScheme()
Implements javax. |
| public String | getEncoding()
Implements javax. |
| public int | getEventType()
Implements javax. |
| public Location | getLocation()
Implements javax. |
| public QName | getName()
Implements javax. |
| private Namespace | |
| public NamespaceContext | getNamespaceContext()
Implements javax. |
| public int | getNamespaceCount()
Implements javax. |
| public String | getNamespacePrefix(int
the position of the namespace declaration index)Implements javax. |
| public String | getNamespaceURI(int
the position of the namespace declaration index)Implements javax. |
| public String | getPIData()
Implements javax. |
| public String | getPITarget()
Implements javax. |
| public Object | getProperty(String
The name of the property, may not be null name)Implements javax. |
| public String | getText()
Implements javax. |
| public int | getTextStart()
Implements javax. |
| public String | getVersion()
Implements javax. |
| public boolean | isAttributeSpecified(int
the position of the attribute index)Implements javax. |
| public boolean | isStandalone()
Implements javax. |
| public int | next()
Implements javax. |
| public boolean | standaloneSet()
Implements javax. |
| event | back to summary |
|---|---|
| private XMLEvent event | |
| eventReader | back to summary |
|---|---|
| private final XMLEventReader eventReader | |
| XMLEventStreamReader | back to summary |
|---|---|
| public XMLEventStreamReader(XMLEventReader eventReader) throws XMLStreamException | |
| close | back to summary |
|---|---|
| public void close() throws XMLStreamException Implements javax. Doc from javax. Frees any resources associated with this Reader. This method does not close the underlying input source.
| |
| countIterator | back to summary |
|---|---|
private static int countIterator(Iterator<E> iterator)
| |
| getAttribute | back to summary |
|---|---|
private Attribute getAttribute(int index)
| |
| getAttributeCount | back to summary |
|---|---|
| public int getAttributeCount() Implements javax. Doc from javax. Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE. This count excludes namespace definitions. Attribute indices are zero-based.
| |
| getAttributeName | back to summary |
|---|---|
| public QName getAttributeName(int index) Implements javax. Doc from javax. Returns the qname of the attribute at the provided index | |
| getAttributeType | back to summary |
|---|---|
| public String getAttributeType(int index) Implements javax. Doc from javax. Returns the XML type of the attribute at the provided index | |
| getAttributeValue | back to summary |
|---|---|
| public String getAttributeValue(int index) Implements javax. Doc from javax. Returns the value of the attribute at the index | |
| getCharacterEncodingScheme | back to summary |
|---|---|
| public String getCharacterEncodingScheme() Implements javax. Doc from javax. Returns the character encoding declared on the xml declaration Returns null if none was declared | |
| getEncoding | back to summary |
|---|---|
| public String getEncoding() Implements javax. Doc from javax. Return input encoding if known or null if unknown. | |
| getEventType | back to summary |
|---|---|
| public int getEventType() Implements javax. Doc from javax. Returns an integer code that indicates the type of the event the cursor is
pointing to. The initial event type is
| |
| getLocation | back to summary |
|---|---|
| public Location getLocation() Implements javax. Doc from javax. Return the current location of the processor. If the Location is unknown the processor should return an implementation of Location that returns -1 for the location and null for the publicId and systemId. The location information is only valid until next() is called. | |
| getName | back to summary |
|---|---|
| public QName getName() Implements javax. Doc from javax. Returns a QName for the current START_ELEMENT or END_ELEMENT event | |
| getNamespace | back to summary |
|---|---|
private Namespace getNamespace(int index)
| |
| getNamespaceContext | back to summary |
|---|---|
| public NamespaceContext getNamespaceContext() Implements javax. Doc from javax. Returns a read only namespace context for the current position. The context is transient and only valid until a call to next() changes the state of the reader.
| |
| getNamespaceCount | back to summary |
|---|---|
| public int getNamespaceCount() Implements javax. Doc from javax. Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On an END_ELEMENT the count is of the namespaces that are about to go out of scope. This is the equivalent of the information reported by SAX callback for an end element event.
| |
| getNamespacePrefix | back to summary |
|---|---|
| public String getNamespacePrefix(int index) Implements javax. Doc from javax. Returns the prefix for the namespace declared at the index. Returns null if this is the default namespace declaration | |
| getNamespaceURI | back to summary |
|---|---|
| public String getNamespaceURI(int index) Implements javax. Doc from javax. Returns the uri for the namespace declared at the index. | |
| getPIData | back to summary |
|---|---|
| public String getPIData() Implements javax. Doc from javax. Get the data section of a processing instruction | |
| getPITarget | back to summary |
|---|---|
| public String getPITarget() Implements javax. Doc from javax. Get the target of a processing instruction | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) throws IllegalArgumentException Implements javax. Doc from javax. Get the value of a feature/property from the underlying implementation
| |
| getText | back to summary |
|---|---|
| public String getText() Implements javax. Doc from javax. Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events. | |
| getTextStart | back to summary |
|---|---|
| public int getTextStart() Implements javax. Doc from javax. Returns the offset into the text character array where the first character (of this text event) is stored.
| |
| getVersion | back to summary |
|---|---|
| public String getVersion() Implements javax. Doc from javax. Get the xml version declared on the xml declaration Returns null if none was declared | |
| isAttributeSpecified | back to summary |
|---|---|
| public boolean isAttributeSpecified(int index) Implements javax. Doc from javax. Returns a boolean which indicates if this attribute was created by default
| |
| isStandalone | back to summary |
|---|---|
| public boolean isStandalone() Implements javax. Doc from javax. Get the standalone declaration from the xml declaration
| |
| next | back to summary |
|---|---|
| public int next() throws XMLStreamException Implements javax. Doc from javax. Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. If the property javax.xml.stream.isCoalescing is set to true element content must be coalesced and only one CHARACTERS event must be returned for contiguous element content or CDATA Sections. By default entity references must be expanded and reported transparently to the application. An exception will be thrown if an entity reference cannot be expanded. If element content is empty (i.e. content is "") then no CHARACTERS event will be reported. Given the following XML: Note empty element (such as
| |
| standaloneSet | back to summary |
|---|---|
| public boolean standaloneSet() Implements javax. Doc from javax. Checks if standalone was set in the document
| |