|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.xml.stream.util.StreamReaderDelegate
public class StreamReaderDelegate
Base class for XML stream reader filters.
| Field Summary |
|---|
| Fields inherited from interface javax.xml.stream.XMLStreamConstants |
|---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
| Constructor Summary | |
|---|---|
StreamReaderDelegate()
Constructs an empty filter with no parent set. |
|
StreamReaderDelegate(XMLStreamReader reader)
Constructs an empty filter with the specfied parent. |
|
| Method Summary | |
|---|---|
void |
close()
Frees any resources used by this parser. |
int |
getAttributeCount()
Returns the number of attributes on this element. |
String |
getAttributeLocalName(int index)
Returns the local-name of the attribute at the given index. |
QName |
getAttributeName(int index)
Returns the QName of the attribute at the given index. |
String |
getAttributeNamespace(int index)
Returns the namespace URI of the attribute at the given index. |
String |
getAttributePrefix(int index)
Returns the namespace prefix of the attribute at the given index. |
String |
getAttributeType(int index)
Returns the type of the attribute at the specified index. |
String |
getAttributeValue(int index)
Returns the normalized value of the attribute at the given index. |
String |
getAttributeValue(String namespaceUri,
String localName)
Returns the normalized attribute value for the given attribute. |
String |
getCharacterEncodingScheme()
Returns the encoding declared in the XML declaration. |
String |
getElementText()
Returns the text content of a text-only element. |
String |
getEncoding()
Returns the input encoding. |
int |
getEventType()
Returns the type of the current event. |
String |
getLocalName()
Returns the local-name of the current element. |
Location |
getLocation()
Returns the current location of the parser cursor in the underlying input source. |
QName |
getName()
Returns the QName of the current element. |
NamespaceContext |
getNamespaceContext()
Returns the namespace context for the current position. |
int |
getNamespaceCount()
Returns the number of namespaces declared on this event. |
String |
getNamespacePrefix(int index)
Returns the prefix of the namespace at the given index, or null if this is the default namespace declaration. |
String |
getNamespaceURI()
Returns the namespace URI of the current element. |
String |
getNamespaceURI(int index)
Returns the URI of the namespace at the given index. |
String |
getNamespaceURI(String prefix)
Returns the namespace URI for the given prefix. |
XMLStreamReader |
getParent()
Returns the parent. |
String |
getPIData()
Returns the data of the current processing instruction event. |
String |
getPITarget()
Returns the target of the current processing instruction event. |
String |
getPrefix()
Returns the namespace prefix of the current element. |
Object |
getProperty(String name)
Returns the implementation-specific feature or property of the given name. |
String |
getText()
Returns the string value of the current event. |
char[] |
getTextCharacters()
Returns the string value of the current event as a character array. |
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
Copies the string value of the current event into the specified character array. |
int |
getTextLength()
Returns the length of the characters in the text character array. |
int |
getTextStart()
Returns the offset of the first character in the text character array. |
String |
getVersion()
Returns the XML version declared in the XML declaration. |
boolean |
hasName()
Indicates whether the current event has a name. |
boolean |
hasNext()
Indicates whether there are any remaining events to be read. |
boolean |
hasText()
Indicates whether the current event has text. |
boolean |
isAttributeSpecified(int index)
Indicates whether the attribute at the given index was specified in the underlying XML source or created by default. |
boolean |
isCharacters()
Indicates whether the current event is character data. |
boolean |
isEndElement()
Indicates whether the current event is END_ELEMENT. |
boolean |
isStandalone()
Returns the standalone flag declared in the XML declaration. |
boolean |
isStartElement()
Indicates whether the current event is START_ELEMENT. |
boolean |
isWhiteSpace()
Indicates whether the current event is ignorable whitespace. |
int |
next()
Returns the next parsing event. |
int |
nextTag()
Skips any ignorable whitespace, comments, and processing instructions until a START_ELEMENT or END_ELEMENT event is encountered. |
void |
require(int type,
String namespaceURI,
String localName)
Tests whether the current event is of the given type and namespace. |
void |
setParent(XMLStreamReader reader)
Sets the parent. |
boolean |
standaloneSet()
Indicates whether the standalone flag was set in the document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamReaderDelegate()
public StreamReaderDelegate(XMLStreamReader reader)
| Method Detail |
|---|
public void setParent(XMLStreamReader reader)
public XMLStreamReader getParent()
public int next()
throws XMLStreamException
XMLStreamReader
next in interface XMLStreamReaderXMLStreamException
public int nextTag()
throws XMLStreamException
XMLStreamReader
nextTag in interface XMLStreamReaderXMLStreamException - if an event of any other type is
encountered
public String getElementText()
throws XMLStreamException
XMLStreamReader
getElementText in interface XMLStreamReaderXMLStreamException
public void require(int type,
String namespaceURI,
String localName)
throws XMLStreamException
XMLStreamReader
require in interface XMLStreamReaderXMLStreamException - if the test fails
public boolean hasNext()
throws XMLStreamException
XMLStreamReader
hasNext in interface XMLStreamReaderXMLStreamException
public void close()
throws XMLStreamException
XMLStreamReader
close in interface XMLStreamReaderXMLStreamExceptionpublic String getNamespaceURI(String prefix)
XMLStreamReader
getNamespaceURI in interface XMLStreamReaderpublic NamespaceContext getNamespaceContext()
XMLStreamReader
getNamespaceContext in interface XMLStreamReaderpublic boolean isStartElement()
XMLStreamReader
isStartElement in interface XMLStreamReaderpublic boolean isEndElement()
XMLStreamReader
isEndElement in interface XMLStreamReaderpublic boolean isCharacters()
XMLStreamReader
isCharacters in interface XMLStreamReaderpublic boolean isWhiteSpace()
XMLStreamReader
isWhiteSpace in interface XMLStreamReader
public String getAttributeValue(String namespaceUri,
String localName)
XMLStreamReader
getAttributeValue in interface XMLStreamReaderpublic int getAttributeCount()
XMLStreamReader
getAttributeCount in interface XMLStreamReaderpublic QName getAttributeName(int index)
XMLStreamReader
getAttributeName in interface XMLStreamReaderpublic String getAttributePrefix(int index)
XMLStreamReader
getAttributePrefix in interface XMLStreamReaderpublic String getAttributeNamespace(int index)
XMLStreamReader
getAttributeNamespace in interface XMLStreamReaderpublic String getAttributeLocalName(int index)
XMLStreamReader
getAttributeLocalName in interface XMLStreamReaderpublic String getAttributeType(int index)
XMLStreamReader
getAttributeType in interface XMLStreamReaderpublic String getAttributeValue(int index)
XMLStreamReader
getAttributeValue in interface XMLStreamReaderpublic boolean isAttributeSpecified(int index)
XMLStreamReader
isAttributeSpecified in interface XMLStreamReaderpublic int getNamespaceCount()
XMLStreamReader
getNamespaceCount in interface XMLStreamReaderpublic String getNamespacePrefix(int index)
XMLStreamReader
getNamespacePrefix in interface XMLStreamReaderpublic String getNamespaceURI(int index)
XMLStreamReader
getNamespaceURI in interface XMLStreamReaderpublic int getEventType()
XMLStreamReader
getEventType in interface XMLStreamReaderpublic String getText()
XMLStreamReader
getText in interface XMLStreamReader
public int getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
throws XMLStreamException
XMLStreamReader
getTextCharacters in interface XMLStreamReaderXMLStreamExceptionpublic char[] getTextCharacters()
XMLStreamReader
getTextCharacters in interface XMLStreamReaderpublic int getTextStart()
XMLStreamReader
getTextStart in interface XMLStreamReaderpublic int getTextLength()
XMLStreamReader
getTextLength in interface XMLStreamReaderpublic String getEncoding()
XMLStreamReader
getEncoding in interface XMLStreamReaderpublic boolean hasText()
XMLStreamReader
hasText in interface XMLStreamReaderpublic Location getLocation()
XMLStreamReader
getLocation in interface XMLStreamReaderpublic QName getName()
XMLStreamReader
getName in interface XMLStreamReaderpublic String getLocalName()
XMLStreamReader
getLocalName in interface XMLStreamReaderpublic boolean hasName()
XMLStreamReader
hasName in interface XMLStreamReaderpublic String getNamespaceURI()
XMLStreamReader
getNamespaceURI in interface XMLStreamReaderpublic String getPrefix()
XMLStreamReader
getPrefix in interface XMLStreamReaderpublic String getVersion()
XMLStreamReader
getVersion in interface XMLStreamReaderpublic boolean isStandalone()
XMLStreamReader
isStandalone in interface XMLStreamReaderpublic boolean standaloneSet()
XMLStreamReader
standaloneSet in interface XMLStreamReaderpublic String getCharacterEncodingScheme()
XMLStreamReader
getCharacterEncodingScheme in interface XMLStreamReaderpublic String getPITarget()
XMLStreamReader
getPITarget in interface XMLStreamReaderpublic String getPIData()
XMLStreamReader
getPIData in interface XMLStreamReaderpublic Object getProperty(String name)
XMLStreamReader
getProperty in interface XMLStreamReader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||