Package org.apache.juneau.xml
Class XmlReader
java.lang.Object
org.apache.juneau.xml.XmlReader
- All Implemented Interfaces:
XMLStreamConstants
,XMLStreamReader
,Positionable
Wrapper class around a
XMLStreamReader
.
The purpose is to encapsulate the reader with the ParserPipe
object so that it can be retrieved for
debugging purposes.
See Also:
-
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
ModifierConstructorDescriptionprotected
XmlReader
(ParserPipe pipe, boolean validating, XMLReporter reporter, XMLResolver resolver, XMLEventAllocator eventAllocator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
getAttributeLocalName
(int index) getAttributeName
(int index) getAttributeNamespace
(int index) getAttributePrefix
(int index) getAttributeType
(int index) getAttributeValue
(int index) getAttributeValue
(String namespaceURI, String localName) int
getName()
int
getNamespacePrefix
(int index) getNamespaceURI
(int index) getNamespaceURI
(String prefix) getPipe()
Returns the pipe passed into the constructor.Returns the current position in a reader or input stream.getProperty
(String name) getText()
char[]
int
getTextCharacters
(int sourceStart, char[] target, int targetStart, int length) int
int
boolean
hasName()
boolean
hasNext()
boolean
hasText()
boolean
isAttributeSpecified
(int index) boolean
boolean
boolean
boolean
boolean
int
next()
int
nextTag()
void
boolean
-
Constructor Details
-
XmlReader
protected XmlReader(ParserPipe pipe, boolean validating, XMLReporter reporter, XMLResolver resolver, XMLEventAllocator eventAllocator) throws IOException, XMLStreamException Constructor.- Parameters:
pipe
- The parser input.validating
- The value for theXMLInputFactory.IS_VALIDATING
setting.reporter
- The value for theXMLInputFactory.REPORTER
setting.resolver
- The value for theXMLInputFactory.RESOLVER
setting.eventAllocator
- The value for theXMLInputFactory.ALLOCATOR
setting.- Throws:
IOException
- Thrown by underlingXMLStreamException
- Thrown by underlying XML stream.
-
-
Method Details
-
getPipe
Returns the pipe passed into the constructor.- Returns:
- The pipe passed into the constructor.
-
close
- Specified by:
close
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getAttributeCount
- Specified by:
getAttributeCount
in interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalName
in interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeName
in interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespace
in interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefix
in interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeType
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getCharacterEncodingScheme
- Specified by:
getCharacterEncodingScheme
in interfaceXMLStreamReader
-
getElementText
- Specified by:
getElementText
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getEncoding
- Specified by:
getEncoding
in interfaceXMLStreamReader
-
getEventType
- Specified by:
getEventType
in interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalName
in interfaceXMLStreamReader
-
getLocation
- Specified by:
getLocation
in interfaceXMLStreamReader
-
getName
- Specified by:
getName
in interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContext
in interfaceXMLStreamReader
-
getNamespaceCount
- Specified by:
getNamespaceCount
in interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefix
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIData
in interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITarget
in interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefix
in interfaceXMLStreamReader
-
getProperty
- Specified by:
getProperty
in interfaceXMLStreamReader
- Throws:
IllegalArgumentException
-
getText
- Specified by:
getText
in interfaceXMLStreamReader
-
getTextCharacters
- Specified by:
getTextCharacters
in interfaceXMLStreamReader
-
getTextCharacters
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException - Specified by:
getTextCharacters
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getTextLength
- Specified by:
getTextLength
in interfaceXMLStreamReader
-
getTextStart
- Specified by:
getTextStart
in interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersion
in interfaceXMLStreamReader
-
hasName
- Specified by:
hasName
in interfaceXMLStreamReader
-
hasNext
- Specified by:
hasNext
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
hasText
- Specified by:
hasText
in interfaceXMLStreamReader
-
isAttributeSpecified
- Specified by:
isAttributeSpecified
in interfaceXMLStreamReader
-
isCharacters
- Specified by:
isCharacters
in interfaceXMLStreamReader
-
isEndElement
- Specified by:
isEndElement
in interfaceXMLStreamReader
-
isStandalone
- Specified by:
isStandalone
in interfaceXMLStreamReader
-
isStartElement
- Specified by:
isStartElement
in interfaceXMLStreamReader
-
isWhiteSpace
- Specified by:
isWhiteSpace
in interfaceXMLStreamReader
-
next
- Specified by:
next
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTag
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
require
- Specified by:
require
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
standaloneSet
- Specified by:
standaloneSet
in interfaceXMLStreamReader
-
getPosition
Description copied from interface:Positionable
Returns the current position in a reader or input stream.- Specified by:
getPosition
in interfacePositionable
- Returns:
- The current position in a reader or input stream.
-