XMLStreamReader.
It also adds limited number of methods that are important for
efficient pass-through processing (such as one needed when routing
SOAP-messages).
The features supported via setFeature are:
Since version 3.0, stream writer will also implement "Typed Access API" on output side.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | FEATURE_DTD_OVERRIDE
Feature used to specify the source for DTD external subset to use instead of DTD specified by the XML document itself (if any). |
| Modifier and Type | Method and Description |
|---|---|
| public void | closeCompletely()
Method similar to
|
| public AttributeInfo | getAttributeInfo()
Method that can be called to get additional information about attributes related to the current start element, as well as related DTD-based information if available. |
| public int | Returns: Number of open elements currently in the reader's stack, including current START_ELEMENT or END_ELEMENT (if pointing to one).Method that returns the number of open elements in the stack; 0 when the reader is in prolog/epilog, 1 inside root element (including when pointing at the root element itself) and so on. |
| public DTDInfo | Returns: Information object for accessing further DOCTYPE information, iff the reader currently points to DTD event, AND is operating in mode that parses such information (DTD-aware at least, and usually also validating)Method that can be called to get information about DOCTYPE declaration that the reader is currently pointing to, if the reader has parsed it. |
| public Object | Returns: Value of the feature (possibly null), if supported; null otherwiseName of the feature of which value to get name)
Deprecated
Should use
Method that can be used to get per-reader values; both generic
ones (names for which are defined as constants in this class),
and implementation dependant ones.
getProperty instead
|
| public LocationInfo | |
| public NamespaceContext | Returns: Non-transient namespace context as explained above.This method returns a namespace context object that contains
information identical to that returned by
|
| public String | Returns: Prefix-qualified name of the current element; essentially 'prefix:localName' if the element has a prefix, or 'localName' if it does not have one (belongs to the default namespace)This method returns "prefix-qualified" name of the current element. |
| public int | Returns: Number of characters written to the readerWriter to use for writing textual contents w, boolean If true, reader has to preserve contents
so that further calls to preserveContents)getText will return
proper conntets. If false, reader is allowed to skip creation
of such copies: this can improve performance, but it also means
that further calls to getText is not guaranteed to
return meaningful data.Method similar to |
| public boolean | Returns: True, if current event is START_ELEMENT and is based on a parsed empty element; otherwise falseMethod that can be used to check whether current START_ELEMENT event was created for an empty element (xml short-hand notation where one tag implies start and end, ending with "/>"), or not. |
| public boolean | isPropertySupported(String name)
Method similar to |
| public void | setFeature(String
Name of the feature to set name, Object Value to set feature to. value)
Deprecated
Should use
Method that can be used to set per-reader features such as configuration
settings; both generic
ones (names for which are defined as constants in this class),
and implementation dependant ones.
setProperty instead
|
| public boolean | Returns: True, if the specified property was succesfully set to specified value; false if its value was not changedName of the property to set name, Object Value to set property to. value)Method that can be used to set per-reader properties; a subset of
properties one can set via matching
|
| public void | skipElement()
Method that will skip all the contents of the element that the stream currently points to. |
| FEATURE_DTD_OVERRIDE | back to summary |
|---|---|
| public static final String FEATURE_DTD_OVERRIDE
Deprecated Use Feature used to specify the source for DTD external subset to use instead of DTD specified by the XML document itself (if any). | |
| closeCompletely | back to summary |
|---|---|
| public void closeCompletely() throws XMLStreamException Method similar to
| |
| getAttributeInfo | back to summary |
|---|---|
| public AttributeInfo getAttributeInfo() throws XMLStreamException Method that can be called to get additional information about
attributes related to the current start element, as well as
related DTD-based information if available. Note that the
reader has to currently point to START_ELEMENT; if not,
a | |
| getDepth | back to summary |
|---|---|
| public int getDepth() Method that returns the number of open elements in the stack; 0 when the reader is in prolog/epilog, 1 inside root element (including when pointing at the root element itself) and so on. Depth is same for matching start/end elements, as well as for the all children of an element.
| |
| getDTDInfo | back to summary |
|---|---|
| public DTDInfo getDTDInfo() throws XMLStreamException Method that can be called to get information about DOCTYPE declaration that the reader is currently pointing to, if the reader has parsed it. Implementations can also choose to return null to indicate they do not provide extra information; but they should not throw any exceptions beyond normal parsing exceptions.
| |
| getFeature | back to summary |
|---|---|
| public Object getFeature(String name)
Deprecated Should use Method that can be used to get per-reader values; both generic ones (names for which are defined as constants in this class), and implementation dependant ones. Note although some feature names are shared with
| |
| getLocationInfo | back to summary |
|---|---|
| public LocationInfo getLocationInfo() | |
| getNonTransientNamespaceContext | back to summary |
|---|---|
| public NamespaceContext getNonTransientNamespaceContext() This method returns a namespace context object that contains
information identical to that returned by
| |
| getPrefixedName | back to summary |
|---|---|
| public String getPrefixedName() This method returns "prefix-qualified" name of the current element. In general, this means character-by-character exact name of the element in XML content, and may be useful in informational purposes, as well as when interacting with packages and APIs that use such names (such as what SAX may use as qnames). Note implementations are encouraged to provide an implementation
that would be more efficient than calling
| |
| getText | back to summary |
|---|---|
| public int getText(Writer w, boolean preserveContents) throws IOException, XMLStreamException Method similar to
Method can only be called on states CDATA, CHARACTERS, COMMENT,
DTD, ENTITY_REFERENCE, SPACE and PROCESSING_INSTRUCTION; if called
when reader is in another state,
| |
| isEmptyElement | back to summary |
|---|---|
| public boolean isEmptyElement() throws XMLStreamException Method that can be used to check whether current START_ELEMENT event was created for an empty element (xml short-hand notation where one tag implies start and end, ending with "/>"), or not. Note method may need to read more data to know if the element
is an empty one, and as such may throw an i/o or parsing exception
(as
| |
| isPropertySupported | back to summary |
|---|---|
| public boolean isPropertySupported(String name) Method similar to | |
| setFeature | back to summary |
|---|---|
| public void setFeature(String name, Object value)
Deprecated Should use Method that can be used to set per-reader features such as configuration settings; both generic ones (names for which are defined as constants in this class), and implementation dependant ones. Note although some feature names are shared with
| |
| setProperty | back to summary |
|---|---|
| public boolean setProperty(String name, Object value) Method that can be used to set per-reader properties; a subset of
properties one can set via matching
| |
| skipElement | back to summary |
|---|---|
| public void skipElement() throws XMLStreamException Method that will skip all the contents of the element that the
stream currently points to. Current event when calling the method
has to be START_ELEMENT (or otherwise | |