Package jadex.xml.stax
Class StaxReaderWrapper
- java.lang.Object
-
- jadex.xml.stax.StaxReaderWrapper
-
- All Implemented Interfaces:
IXMLReader
public class StaxReaderWrapper extends java.lang.Object implements IXMLReader
Wrapper for the Java stax interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.BufferedInputStream
bis
The stream.protected XmlTag
closedtag
The last tag that was closed.protected javax.xml.stream.XMLStreamReader
reader
The wrapped reader.protected java.util.LinkedList<XmlTag>
tagstack
The current tag.
-
Constructor Summary
Constructors Constructor Description StaxReaderWrapper(java.io.InputStream in)
StaxReaderWrapper(javax.xml.stream.XMLStreamReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the reader.int
getAttributeCount()
java.lang.String
getAttributeLocalName(int i)
java.lang.String
getAttributeNamespace(int i)
java.lang.String
getAttributePrefix(int i)
java.util.Map<java.lang.String,java.lang.String>
getAttributes()
Returns the attributes.java.lang.String
getAttributeValue(int i)
XmlTag
getClosedTag()
Get the XML tag struct of the last closed tag.int
getEventType()
Gets the XML event type.java.lang.String
getLocalName()
ILocation
getLocation()
Returns the current parser location.QName
getName()
java.lang.String
getText()
Get the text for the element.XmlTag
getXmlTag()
Get the XML tag struct.java.util.LinkedList<XmlTag>
getXmlTagStack()
Get the XML tag stack.boolean
hasNext()
Returns if the reader has more events.int
next()
Selects the next event.
-
-
-
Method Detail
-
getEventType
public int getEventType()
Gets the XML event type.- Specified by:
getEventType
in interfaceIXMLReader
- Returns:
- Event type.
-
hasNext
public boolean hasNext()
Returns if the reader has more events.- Specified by:
hasNext
in interfaceIXMLReader
- Returns:
- True, if there are more events.
-
next
public int next()
Selects the next event.- Specified by:
next
in interfaceIXMLReader
-
getXmlTag
public XmlTag getXmlTag()
Get the XML tag struct.- Specified by:
getXmlTag
in interfaceIXMLReader
- Returns:
- Struct defining the tag.
-
getClosedTag
public XmlTag getClosedTag()
Get the XML tag struct of the last closed tag.- Specified by:
getClosedTag
in interfaceIXMLReader
- Returns:
- Struct defining the tag.
-
getXmlTagStack
public java.util.LinkedList<XmlTag> getXmlTagStack()
Get the XML tag stack.- Specified by:
getXmlTagStack
in interfaceIXMLReader
- Returns:
- Stack defining the tags.
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns the attributes.- Specified by:
getAttributes
in interfaceIXMLReader
- Returns:
- The attributes.
-
getText
public java.lang.String getText()
Get the text for the element.- Specified by:
getText
in interfaceIXMLReader
- Returns:
- The text.
-
close
public void close()
Closes the reader.- Specified by:
close
in interfaceIXMLReader
-
getLocation
public ILocation getLocation()
Returns the current parser location.- Specified by:
getLocation
in interfaceIXMLReader
- Returns:
- Location
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalName
in interfaceIXMLReader
-
getAttributeCount
public int getAttributeCount()
- Specified by:
getAttributeCount
in interfaceIXMLReader
-
getAttributeLocalName
public java.lang.String getAttributeLocalName(int i)
- Specified by:
getAttributeLocalName
in interfaceIXMLReader
-
getAttributeValue
public java.lang.String getAttributeValue(int i)
- Specified by:
getAttributeValue
in interfaceIXMLReader
-
getName
public QName getName()
- Specified by:
getName
in interfaceIXMLReader
-
getAttributePrefix
public java.lang.String getAttributePrefix(int i)
- Specified by:
getAttributePrefix
in interfaceIXMLReader
-
getAttributeNamespace
public java.lang.String getAttributeNamespace(int i)
- Specified by:
getAttributeNamespace
in interfaceIXMLReader
-
-