public class EwsXmlReader extends Object
Constructor and Description |
---|
EwsXmlReader(InputStream stream)
Initializes a new instance of the EwsXmlReader class.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkEndElement(XMLEvent startEvent,
XMLEvent endEvent)
Check end element.
|
void |
ensureCurrentNodeIsEndElement(XmlNamespace xmlNamespace,
String localName)
Ensures the current node is start element.
|
void |
ensureCurrentNodeIsStartElement()
Ensures the current node is start element.
|
void |
ensureCurrentNodeIsStartElement(XmlNamespace xmlNamespace,
String localName)
Ensures the current node is start element.
|
String |
getLocalName()
Gets the local name of the current element.
|
protected Object |
getName()
Gets the name of the current element.
|
protected String |
getNamespacePrefix()
Gets the namespace prefix.
|
String |
getNamespaceUri()
Gets the namespace URI.
|
XmlNodeType |
getNodeType()
Gets the type of the node.
|
XMLEventReader |
getXmlReaderForNode()
Gets the XML reader for node.
|
boolean |
hasAttributes()
Gets a value indicating whether this instance has attribute.
|
protected XMLEventReader |
initializeXmlReader(InputStream stream)
Initializes the XML reader.
|
boolean |
isEmptyElement()
Gets a value indicating whether current element is empty.
|
boolean |
isEndElement(String namespacePrefix,
String localName)
Determines whether current element is a end element.
|
boolean |
isEndElement(XmlNamespace xmlNamespace,
String localName)
Determines whether current element is a end element.
|
boolean |
isStartElement()
Determines whether current element is a start element.
|
boolean |
isStartElement(String namespacePrefix,
String localName)
Determines whether current element is a start element.
|
boolean |
isStartElement(XmlNamespace xmlNamespace,
String localName)
Determines whether current element is a start element.
|
void |
read()
Reads the specified node type.
|
void |
read(XmlNodeType nodeType)
Reads the specified node type.
|
<T> T |
readAttributeValue(Class<T> cls,
String attributeName)
Reads the attribute value.
|
String |
readAttributeValue(String attributeName)
Reads the attribute value.
|
String |
readAttributeValue(XmlNamespace xmlNamespace,
String attributeName)
Reads the attribute value.
|
byte[] |
readBase64ElementValue()
Reads the base64 element value.
|
void |
readBase64ElementValue(OutputStream outputStream)
Reads the base64 element value.
|
String |
readElementValue()
Read element value.
|
<T> T |
readElementValue(Class<T> cls)
Read element value.
|
<T> T |
readElementValue(Class<T> cls,
XmlNamespace xmlNamespace,
String localName)
Reads the element value.
|
String |
readElementValue(String namespacePrefix,
String localName)
Reads the element value.
|
String |
readElementValue(XmlNamespace xmlNamespace,
String localName)
Reads the element value.
|
void |
readEndElement(String namespacePrefix,
String elementName)
Reads the end element.
|
void |
readEndElement(XmlNamespace xmlNamespace,
String localName)
Reads the end element.
|
void |
readEndElementIfNecessary(XmlNamespace xmlNamespace,
String localName)
Reads the end element if necessary.
|
String |
readInnerXml()
Reads the Inner XML at the given location.
|
<T> T |
readNullableAttributeValue(Class<T> cls,
String attributeName)
Reads a nullable attribute value.
|
String |
readOuterXml()
Outer XML as string.
|
void |
readStartElement(String namespacePrefix,
String localName)
Reads the start element.
|
void |
readStartElement(XmlNamespace xmlNamespace,
String localName)
Reads the start element.
|
XMLEventReader |
readSubtree() |
boolean |
readToDescendant(String localName,
String namespaceURI) |
void |
readToDescendant(XmlNamespace xmlNamespace,
String localName)
Reads to the next descendant element with the specified local name and
namespace.
|
String |
readValue()
Reads the value.
|
String |
readValue(boolean keepWhiteSpace)
Reads the value.
|
<T> T |
readValue(Class<T> cls)
Reads the value.
|
void |
skipCurrentElement()
Skips the current element.
|
void |
skipElement(String namespacePrefix,
String localName)
Skips the element.
|
void |
skipElement(XmlNamespace xmlNamespace,
String localName)
Skips the element.
|
boolean |
tryReadValue(OutParam<String> value)
Tries to read value.
|
public EwsXmlReader(InputStream stream) throws Exception
stream
- the streamException
- on errorprotected XMLEventReader initializeXmlReader(InputStream stream) throws Exception
stream
- the streamException
- on errorpublic void read() throws ServiceXmlDeserializationException, XMLStreamException
ServiceXmlDeserializationException
- the service xml deserialization exceptionXMLStreamException
- the XML stream exceptionpublic void read(XmlNodeType nodeType) throws Exception
nodeType
- Type of the node.Exception
- the exceptionpublic String readAttributeValue(XmlNamespace xmlNamespace, String attributeName) throws Exception
xmlNamespace
- The XML namespace.attributeName
- Name of the attributeException
- the exceptionpublic String readAttributeValue(String attributeName) throws Exception
attributeName
- Name of the attributeException
- the exceptionpublic <T> T readAttributeValue(Class<T> cls, String attributeName) throws Exception
T
- the generic typecls
- the clsattributeName
- the attribute nameException
- the exceptionpublic <T> T readNullableAttributeValue(Class<T> cls, String attributeName) throws Exception
T
- the generic typecls
- the clsattributeName
- the attribute nameException
- the exceptionpublic String readElementValue(String namespacePrefix, String localName) throws Exception
namespacePrefix
- the namespace prefixlocalName
- the local nameException
- the exceptionpublic String readElementValue(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic String readElementValue() throws Exception
Exception
- the exceptionpublic <T> T readElementValue(Class<T> cls, XmlNamespace xmlNamespace, String localName) throws Exception
T
- the generic typecls
- the clsxmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic <T> T readElementValue(Class<T> cls) throws Exception
T
- the generic typecls
- the clsException
- the exceptionpublic String readValue() throws XMLStreamException, ServiceXmlDeserializationException
XMLStreamException
- the XML stream exceptionServiceXmlDeserializationException
- the service xml deserialization exceptionpublic String readValue(boolean keepWhiteSpace) throws XMLStreamException, ServiceXmlDeserializationException
keepWhiteSpace
- Do not remove whitespace characters if trueXMLStreamException
- the XML stream exceptionServiceXmlDeserializationException
- the service xml deserialization exceptionpublic boolean tryReadValue(OutParam<String> value) throws XMLStreamException, ServiceXmlDeserializationException
value
- the valueXMLStreamException
- the XML stream exceptionServiceXmlDeserializationException
- the service xml deserialization exceptionpublic <T> T readValue(Class<T> cls) throws Exception
T
- the generic typecls
- the clsException
- the exceptionpublic byte[] readBase64ElementValue() throws ServiceXmlDeserializationException, XMLStreamException, IOException
ServiceXmlDeserializationException
- the service xml deserialization exceptionXMLStreamException
- the XML stream exceptionIOException
- signals that an I/O exception has occurredpublic void readBase64ElementValue(OutputStream outputStream) throws Exception
outputStream
- the output streamException
- the exceptionpublic void readStartElement(String namespacePrefix, String localName) throws Exception
namespacePrefix
- the namespace prefixlocalName
- the local nameException
- the exceptionpublic void readStartElement(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic void readEndElement(String namespacePrefix, String elementName) throws Exception
namespacePrefix
- the namespace prefixelementName
- the element nameException
- the exceptionpublic void readEndElement(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic void readEndElementIfNecessary(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic boolean isStartElement()
public boolean isStartElement(String namespacePrefix, String localName)
namespacePrefix
- the namespace prefixlocalName
- the local namepublic boolean isStartElement(XmlNamespace xmlNamespace, String localName)
xmlNamespace
- the xml namespacelocalName
- the local namepublic boolean isEndElement(String namespacePrefix, String localName)
namespacePrefix
- the namespace prefixlocalName
- the local namepublic boolean isEndElement(XmlNamespace xmlNamespace, String localName)
xmlNamespace
- the xml namespacelocalName
- the local namepublic void skipElement(String namespacePrefix, String localName) throws Exception
namespacePrefix
- the namespace prefixlocalName
- the local nameException
- the exceptionpublic void skipElement(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic void skipCurrentElement() throws Exception
Exception
- the exceptionpublic void ensureCurrentNodeIsStartElement(XmlNamespace xmlNamespace, String localName) throws ServiceXmlDeserializationException
xmlNamespace
- the xml namespacelocalName
- the local nameServiceXmlDeserializationException
- the service xml deserialization exceptionpublic void ensureCurrentNodeIsStartElement() throws ServiceXmlDeserializationException
ServiceXmlDeserializationException
- the service xml deserialization exceptionpublic void ensureCurrentNodeIsEndElement(XmlNamespace xmlNamespace, String localName) throws Exception
xmlNamespace
- the xml namespacelocalName
- the local nameException
- the exceptionpublic String readOuterXml() throws ServiceXmlDeserializationException, XMLStreamException
ServiceXmlDeserializationException
- the service xml deserialization exceptionXMLStreamException
- the XML stream exceptionpublic String readInnerXml() throws ServiceXmlDeserializationException, XMLStreamException
ServiceXmlDeserializationException
- the service xml deserialization exceptionXMLStreamException
- the XML stream exceptionpublic static boolean checkEndElement(XMLEvent startEvent, XMLEvent endEvent)
startEvent
- the start eventendEvent
- the end eventpublic XMLEventReader getXmlReaderForNode() throws FileNotFoundException, ServiceXmlDeserializationException, XMLStreamException
XMLStreamException
- the XML stream exceptionServiceXmlDeserializationException
- the service xml deserialization exceptionFileNotFoundException
- the file not found exceptionpublic XMLEventReader readSubtree() throws XMLStreamException, FileNotFoundException, ServiceXmlDeserializationException
public void readToDescendant(XmlNamespace xmlNamespace, String localName) throws XMLStreamException
xmlNamespace
- The namespace of the element you with to move to.localName
- The local name of the element you wish to move to.XMLStreamException
- the XML stream exceptionpublic boolean readToDescendant(String localName, String namespaceURI) throws XMLStreamException
XMLStreamException
public boolean hasAttributes()
public boolean isEmptyElement() throws XMLStreamException
XMLStreamException
- the XML stream exceptionpublic String getLocalName()
protected String getNamespacePrefix()
public String getNamespaceUri()
public XmlNodeType getNodeType() throws XMLStreamException
XMLStreamException
- the XML stream exceptionCopyright © 2012–2015 Microsoft. All rights reserved.