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
ConstructorsModifierConstructorDescriptionprotectedXmlReader(ParserPipe pipe, boolean validating, XMLReporter reporter, XMLResolver resolver, XMLEventAllocator eventAllocator) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intgetAttributeLocalName(int index) getAttributeName(int index) getAttributeNamespace(int index) getAttributePrefix(int index) getAttributeType(int index) getAttributeValue(int index) getAttributeValue(String namespaceURI, String localName) intgetName()intgetNamespacePrefix(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[]intgetTextCharacters(int sourceStart, char[] target, int targetStart, int length) intintbooleanhasName()booleanhasNext()booleanhasText()booleanisAttributeSpecified(int index) booleanbooleanbooleanbooleanbooleanintnext()intnextTag()voidboolean
-
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_VALIDATINGsetting.reporter- The value for theXMLInputFactory.REPORTERsetting.resolver- The value for theXMLInputFactory.RESOLVERsetting.eventAllocator- The value for theXMLInputFactory.ALLOCATORsetting.- Throws:
IOException- Thrown by underlingXMLStreamException- Thrown by underlying XML stream.
-
-
Method Details
-
close
- Specified by:
closein interfaceXMLStreamReader- Throws:
XMLStreamException
-
getAttributeCount
- Specified by:
getAttributeCountin interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalNamein interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeNamein interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespacein interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefixin interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeTypein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getCharacterEncodingScheme
- Specified by:
getCharacterEncodingSchemein interfaceXMLStreamReader
-
getElementText
- Specified by:
getElementTextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
getEncoding
- Specified by:
getEncodingin interfaceXMLStreamReader
-
getEventType
- Specified by:
getEventTypein interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalNamein interfaceXMLStreamReader
-
getLocation
- Specified by:
getLocationin interfaceXMLStreamReader
-
getName
- Specified by:
getNamein interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLStreamReader
-
getNamespaceCount
- Specified by:
getNamespaceCountin interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefixin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIDatain interfaceXMLStreamReader
-
getPipe
Returns the pipe passed into the constructor.- Returns:
- The pipe passed into the constructor.
-
getPITarget
- Specified by:
getPITargetin interfaceXMLStreamReader
-
getPosition
Description copied from interface:PositionableReturns the current position in a reader or input stream.- Specified by:
getPositionin interfacePositionable- Returns:
- The current position in a reader or input stream.
-
getPrefix
- Specified by:
getPrefixin interfaceXMLStreamReader
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamReader- Throws:
IllegalArgumentException
-
getText
- Specified by:
getTextin interfaceXMLStreamReader
-
getTextCharacters
- Specified by:
getTextCharactersin interfaceXMLStreamReader
-
getTextCharacters
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException - Specified by:
getTextCharactersin interfaceXMLStreamReader- Throws:
XMLStreamException
-
getTextLength
- Specified by:
getTextLengthin interfaceXMLStreamReader
-
getTextStart
- Specified by:
getTextStartin interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersionin interfaceXMLStreamReader
-
hasName
- Specified by:
hasNamein interfaceXMLStreamReader
-
hasNext
- Specified by:
hasNextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
hasText
- Specified by:
hasTextin interfaceXMLStreamReader
-
isAttributeSpecified
- Specified by:
isAttributeSpecifiedin interfaceXMLStreamReader
-
isCharacters
- Specified by:
isCharactersin interfaceXMLStreamReader
-
isEndElement
- Specified by:
isEndElementin interfaceXMLStreamReader
-
isStandalone
- Specified by:
isStandalonein interfaceXMLStreamReader
-
isStartElement
- Specified by:
isStartElementin interfaceXMLStreamReader
-
isWhiteSpace
- Specified by:
isWhiteSpacein interfaceXMLStreamReader
-
next
- Specified by:
nextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTagin interfaceXMLStreamReader- Throws:
XMLStreamException
-
require
- Specified by:
requirein interfaceXMLStreamReader- Throws:
XMLStreamException
-
standaloneSet
- Specified by:
standaloneSetin interfaceXMLStreamReader
-