|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.odysseus.staxon.base.AbstractXMLStreamReader<T>
public abstract class AbstractXMLStreamReader<T>
Abstract XML stream reader.
| 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 | |
|---|---|
AbstractXMLStreamReader(T rootInfo)
Create new reader instance. |
|
AbstractXMLStreamReader(T rootInfo,
Location locationProvider)
Create new reader instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
protected abstract boolean |
consume()
Main method to be implemented by subclasses. |
int |
getAttributeCount()
|
String |
getAttributeLocalName(int index)
|
QName |
getAttributeName(int index)
|
String |
getAttributeNamespace(int index)
|
String |
getAttributePrefix(int index)
|
String |
getAttributeType(int index)
|
String |
getAttributeValue(int index)
|
String |
getAttributeValue(String namespaceURI,
String localName)
|
String |
getCharacterEncodingScheme()
|
String |
getElementText()
|
String |
getEncoding()
|
protected Object |
getEventData()
|
protected String |
getEventName()
|
int |
getEventType()
|
String |
getLocalName()
|
Location |
getLocation()
|
QName |
getName()
|
NamespaceContext |
getNamespaceContext()
|
int |
getNamespaceCount()
|
String |
getNamespacePrefix(int index)
|
String |
getNamespaceURI()
|
String |
getNamespaceURI(int index)
|
String |
getNamespaceURI(String prefix)
|
String |
getPIData()
|
String |
getPITarget()
|
String |
getPrefix()
|
Object |
getProperty(String name)
|
protected XMLStreamReaderScope<T> |
getScope()
|
String |
getText()
|
char[] |
getTextCharacters()
|
int |
getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
|
int |
getTextLength()
|
int |
getTextStart()
|
String |
getVersion()
|
boolean |
hasName()
|
boolean |
hasNext()
|
boolean |
hasText()
|
protected void |
initialize()
Consume initial event. |
boolean |
isAttributeSpecified(int index)
|
boolean |
isCharacters()
|
boolean |
isEndElement()
|
boolean |
isStandalone()
|
protected boolean |
isStartDocumentRead()
|
boolean |
isStartElement()
|
boolean |
isWhiteSpace()
|
int |
next()
|
int |
nextTag()
|
protected void |
readAttr(String prefix,
String localName,
String namespaceURI,
String value)
Read attribute. |
protected void |
readData(String text,
Object data,
int type)
Read characters/comment/dtd/entity data. |
protected void |
readEndDocument()
Read end document. |
protected void |
readEndElementTag()
Read end element. |
protected void |
readNsDecl(String prefix,
String namespaceURI)
Read namespace declaration. |
protected void |
readPI(String target,
String data)
Read processing instruction. |
protected void |
readStartDocument(String version,
String encodingScheme,
Boolean standalone)
Read start document |
protected void |
readStartElementTag(String prefix,
String localName,
String namespaceURI,
T scopeInfo)
Read start element. |
void |
require(int eventType,
String namespaceURI,
String localName)
|
boolean |
standaloneSet()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractXMLStreamReader(T rootInfo)
rootInfo - root scope information
public AbstractXMLStreamReader(T rootInfo,
Location locationProvider)
rootInfo - root scope information| Method Detail |
|---|
protected XMLStreamReaderScope<T> getScope()
protected boolean isStartDocumentRead()
true if START_DOCUMENT event has been read
protected void initialize()
throws XMLStreamException
XMLStreamException
protected abstract boolean consume()
throws XMLStreamException,
IOException
readXXX() methods.
When encountering an element start event, all attributes and namespace delarations
must be consumed too, otherwise these won't be available during start element.
true if there's more to read
XMLStreamException
IOException
protected void readStartDocument(String version,
String encodingScheme,
Boolean standalone)
throws XMLStreamException
version - XML versionencodingScheme - encoding scheme (may be null)standalone - standalone flag (may be null)
XMLStreamException
protected void readStartElementTag(String prefix,
String localName,
String namespaceURI,
T scopeInfo)
throws XMLStreamException
scopeInfo is
stored in the new scope and will be available via getScope().getInfo().
prefix - element prefix (use null if unknown)localName - local namenamespaceURI - (use null if unknown)scopeInfo - new scope info
XMLStreamException
protected void readAttr(String prefix,
String localName,
String namespaceURI,
String value)
throws XMLStreamException
prefix - attribute prefix (use null if unknown)localName - local namenamespaceURI - (use null if unknown)value - attribute value
XMLStreamException
protected void readNsDecl(String prefix,
String namespaceURI)
throws XMLStreamException
prefix - namespace prefix (must not be null)namespaceURI - namespace URI (must not be null)
XMLStreamException
protected void readData(String text,
Object data,
int type)
throws XMLStreamException
text - textdata - additional data exposed by getEventData() (e.g. type conversion)type - one of CHARACTERS, COMMENT, CDATA, DTD, ENTITY_REFERENCE, SPACE
XMLStreamException
protected void readPI(String target,
String data)
throws XMLStreamException
target - PI targetdata - PI data (may be null)
XMLStreamException
protected void readEndElementTag()
throws XMLStreamException
XMLStreamException
protected void readEndDocument()
throws XMLStreamException
XMLStreamException
public void require(int eventType,
String namespaceURI,
String localName)
throws XMLStreamException
require in interface XMLStreamReaderXMLStreamException
public String getElementText()
throws XMLStreamException
getElementText in interface XMLStreamReaderXMLStreamException
public boolean hasNext()
throws XMLStreamException
hasNext in interface XMLStreamReaderXMLStreamException
public int next()
throws XMLStreamException
next in interface XMLStreamReaderXMLStreamException
public int nextTag()
throws XMLStreamException
nextTag in interface XMLStreamReaderXMLStreamException
public void close()
throws XMLStreamException
close in interface XMLStreamReaderXMLStreamExceptionpublic boolean isStartElement()
isStartElement in interface XMLStreamReaderpublic boolean isEndElement()
isEndElement in interface XMLStreamReaderpublic boolean isCharacters()
isCharacters in interface XMLStreamReaderpublic boolean isWhiteSpace()
isWhiteSpace in interface XMLStreamReaderpublic int getAttributeCount()
getAttributeCount in interface XMLStreamReaderpublic QName getAttributeName(int index)
getAttributeName in interface XMLStreamReaderpublic String getAttributeLocalName(int index)
getAttributeLocalName in interface XMLStreamReaderpublic String getAttributeValue(int index)
getAttributeValue in interface XMLStreamReaderpublic String getAttributePrefix(int index)
getAttributePrefix in interface XMLStreamReaderpublic String getAttributeNamespace(int index)
getAttributeNamespace in interface XMLStreamReaderpublic String getAttributeType(int index)
getAttributeType in interface XMLStreamReaderpublic boolean isAttributeSpecified(int index)
isAttributeSpecified in interface XMLStreamReader
public String getAttributeValue(String namespaceURI,
String localName)
getAttributeValue in interface XMLStreamReaderpublic String getNamespaceURI(String prefix)
getNamespaceURI in interface XMLStreamReaderpublic int getNamespaceCount()
getNamespaceCount in interface XMLStreamReaderpublic String getNamespacePrefix(int index)
getNamespacePrefix in interface XMLStreamReaderpublic String getNamespaceURI(int index)
getNamespaceURI in interface XMLStreamReaderpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamReaderpublic int getEventType()
getEventType in interface XMLStreamReaderprotected String getEventName()
protected final Object getEventData()
public Location getLocation()
getLocation in interface XMLStreamReaderpublic boolean hasText()
hasText in interface XMLStreamReaderpublic String getText()
getText in interface XMLStreamReaderpublic char[] getTextCharacters()
getTextCharacters in interface XMLStreamReader
public int getTextCharacters(int sourceStart,
char[] target,
int targetStart,
int length)
throws XMLStreamException
getTextCharacters in interface XMLStreamReaderXMLStreamExceptionpublic int getTextStart()
getTextStart in interface XMLStreamReaderpublic int getTextLength()
getTextLength in interface XMLStreamReaderpublic boolean hasName()
hasName in interface XMLStreamReaderpublic QName getName()
getName in interface XMLStreamReaderpublic String getLocalName()
getLocalName in interface XMLStreamReaderpublic String getNamespaceURI()
getNamespaceURI in interface XMLStreamReaderpublic String getPrefix()
getPrefix in interface XMLStreamReaderpublic String getVersion()
getVersion in interface XMLStreamReaderpublic String getEncoding()
getEncoding in interface XMLStreamReaderpublic boolean isStandalone()
isStandalone in interface XMLStreamReaderpublic boolean standaloneSet()
standaloneSet in interface XMLStreamReaderpublic String getCharacterEncodingScheme()
getCharacterEncodingScheme in interface XMLStreamReaderpublic String getPITarget()
getPITarget in interface XMLStreamReaderpublic String getPIData()
getPIData in interface XMLStreamReader
public Object getProperty(String name)
throws IllegalArgumentException
getProperty in interface XMLStreamReaderIllegalArgumentExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||