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.BufferedInputStreambisThe stream.protected XmlTagclosedtagThe last tag that was closed.protected javax.xml.stream.XMLStreamReaderreaderThe wrapped reader.protected java.util.LinkedList<XmlTag>tagstackThe 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 voidclose()Closes the reader.intgetAttributeCount()java.lang.StringgetAttributeLocalName(int i)java.lang.StringgetAttributeNamespace(int i)java.lang.StringgetAttributePrefix(int i)java.util.Map<java.lang.String,java.lang.String>getAttributes()Returns the attributes.java.lang.StringgetAttributeValue(int i)XmlTaggetClosedTag()Get the XML tag struct of the last closed tag.intgetEventType()Gets the XML event type.java.lang.StringgetLocalName()ILocationgetLocation()Returns the current parser location.QNamegetName()java.lang.StringgetText()Get the text for the element.XmlTaggetXmlTag()Get the XML tag struct.java.util.LinkedList<XmlTag>getXmlTagStack()Get the XML tag stack.booleanhasNext()Returns if the reader has more events.intnext()Selects the next event.
-
-
-
Method Detail
-
getEventType
public int getEventType()
Gets the XML event type.- Specified by:
getEventTypein interfaceIXMLReader- Returns:
- Event type.
-
hasNext
public boolean hasNext()
Returns if the reader has more events.- Specified by:
hasNextin interfaceIXMLReader- Returns:
- True, if there are more events.
-
next
public int next()
Selects the next event.- Specified by:
nextin interfaceIXMLReader
-
getXmlTag
public XmlTag getXmlTag()
Get the XML tag struct.- Specified by:
getXmlTagin interfaceIXMLReader- Returns:
- Struct defining the tag.
-
getClosedTag
public XmlTag getClosedTag()
Get the XML tag struct of the last closed tag.- Specified by:
getClosedTagin interfaceIXMLReader- Returns:
- Struct defining the tag.
-
getXmlTagStack
public java.util.LinkedList<XmlTag> getXmlTagStack()
Get the XML tag stack.- Specified by:
getXmlTagStackin interfaceIXMLReader- Returns:
- Stack defining the tags.
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns the attributes.- Specified by:
getAttributesin interfaceIXMLReader- Returns:
- The attributes.
-
getText
public java.lang.String getText()
Get the text for the element.- Specified by:
getTextin interfaceIXMLReader- Returns:
- The text.
-
close
public void close()
Closes the reader.- Specified by:
closein interfaceIXMLReader
-
getLocation
public ILocation getLocation()
Returns the current parser location.- Specified by:
getLocationin interfaceIXMLReader- Returns:
- Location
-
getLocalName
public java.lang.String getLocalName()
- Specified by:
getLocalNamein interfaceIXMLReader
-
getAttributeCount
public int getAttributeCount()
- Specified by:
getAttributeCountin interfaceIXMLReader
-
getAttributeLocalName
public java.lang.String getAttributeLocalName(int i)
- Specified by:
getAttributeLocalNamein interfaceIXMLReader
-
getAttributeValue
public java.lang.String getAttributeValue(int i)
- Specified by:
getAttributeValuein interfaceIXMLReader
-
getName
public QName getName()
- Specified by:
getNamein interfaceIXMLReader
-
getAttributePrefix
public java.lang.String getAttributePrefix(int i)
- Specified by:
getAttributePrefixin interfaceIXMLReader
-
getAttributeNamespace
public java.lang.String getAttributeNamespace(int i)
- Specified by:
getAttributeNamespacein interfaceIXMLReader
-
-