/** * Reads the value. Should return content element or text node as string * Present event must be START ELEMENT. After executing this function * Present event will be set on END ELEMENT * * @return String * @throws XMLStreamException the XML stream exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ public String readValue() throws XMLStreamException, ServiceXmlDeserializationException { return readValue(false); }
/** * Reads the value. * * @param <T> the generic type * @param cls the cls * @return T * @throws Exception the exception */ public <T> T readValue(Class<T> cls) throws Exception { return EwsUtilities.parse(cls, this.readValue()); }
/** * Read element value. * * @param <T> the generic type * @param cls the cls * @return T * @throws Exception the exception */ public <T> T readElementValue(Class<T> cls) throws Exception { this.ensureCurrentNodeIsStartElement(); T value = null; if (!this.isEmptyElement()) { value = this.readValue(cls); } return value; }
/** * Reads the element value. * * @param namespacePrefix the namespace prefix * @param localName the local name * @return String * @throws Exception the exception */ public String readElementValue(String namespacePrefix, String localName) throws Exception { if (!this.isStartElement(namespacePrefix, localName)) { this.readStartElement(namespacePrefix, localName); } String value = null; if (!this.isEmptyElement()) { value = this.readValue(); } return value; }
/** * Reads the element value. * * @param <T> the generic type * @param cls the cls * @param xmlNamespace the xml namespace * @param localName the local name * @return T * @throws Exception the exception */ public <T> T readElementValue(Class<T> cls, XmlNamespace xmlNamespace, String localName) throws Exception { if (!this.isStartElement(xmlNamespace, localName)) { this.readStartElement(xmlNamespace, localName); } T value = null; if (!this.isEmptyElement()) { value = this.readValue(cls); } return value; }
/** * Reads the element value. * * @param xmlNamespace the xml namespace * @param localName the local name * @return String * @throws Exception the exception */ public String readElementValue(XmlNamespace xmlNamespace, String localName) throws Exception { if (!this.isStartElement(xmlNamespace, localName)) { this.readStartElement(xmlNamespace, localName); } String value = null; if (!this.isEmptyElement()) { value = this.readValue(); } else { this.read(); } return value; }
/** * Tries to read value. * * @param value the value * @return boolean * @throws XMLStreamException the XML stream exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ public boolean tryReadValue(OutParam<String> value) throws XMLStreamException, ServiceXmlDeserializationException { if (!this.isEmptyElement()) { this.read(); if (this.presentEvent.isCharacters()) { value.setParam(this.readValue()); return true; } else { return false; } } else { return false; } }
/** * Reads the value. Should return content element or text node as string * Present event must be START ELEMENT. After executing this function * Present event will be set on END ELEMENT * * @return String * @throws XMLStreamException the XML stream exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ public String readValue() throws XMLStreamException, ServiceXmlDeserializationException { return readValue(false); }
/** * Reads the value. * * @param <T> the generic type * @param cls the cls * @return T * @throws Exception the exception */ public <T> T readValue(Class<T> cls) throws Exception { return EwsUtilities.parse(cls, this.readValue()); }
/** * Read element value. * * @param <T> the generic type * @param cls the cls * @return T * @throws Exception the exception */ public <T> T readElementValue(Class<T> cls) throws Exception { this.ensureCurrentNodeIsStartElement(); T value = null; if (!this.isEmptyElement()) { value = this.readValue(cls); } return value; }
/** * Reads the element value. * * @param <T> the generic type * @param cls the cls * @param xmlNamespace the xml namespace * @param localName the local name * @return T * @throws Exception the exception */ public <T> T readElementValue(Class<T> cls, XmlNamespace xmlNamespace, String localName) throws Exception { if (!this.isStartElement(xmlNamespace, localName)) { this.readStartElement(xmlNamespace, localName); } T value = null; if (!this.isEmptyElement()) { value = this.readValue(cls); } return value; }
/** * Reads the element value. * * @param namespacePrefix the namespace prefix * @param localName the local name * @return String * @throws Exception the exception */ public String readElementValue(String namespacePrefix, String localName) throws Exception { if (!this.isStartElement(namespacePrefix, localName)) { this.readStartElement(namespacePrefix, localName); } String value = null; if (!this.isEmptyElement()) { value = this.readValue(); } return value; }
/** * Tries to read value. * * @param value the value * @return boolean * @throws XMLStreamException the XML stream exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ public boolean tryReadValue(OutParam<String> value) throws XMLStreamException, ServiceXmlDeserializationException { if (!this.isEmptyElement()) { this.read(); if (this.presentEvent.isCharacters()) { value.setParam(this.readValue()); return true; } else { return false; } } else { return false; } }
/** * Reads the element value. * * @param xmlNamespace the xml namespace * @param localName the local name * @return String * @throws Exception the exception */ public String readElementValue(XmlNamespace xmlNamespace, String localName) throws Exception { if (!this.isStartElement(xmlNamespace, localName)) { this.readStartElement(xmlNamespace, localName); } String value = null; if (!this.isEmptyElement()) { value = this.readValue(); } else { this.read(); } return value; }