/** * Reads the attribute value. * * @param attributeName Name of the attribute * @return Attribute value. * @throws Exception the exception */ public String readAttributeValue(String attributeName) throws Exception { QName qName = new QName(attributeName); return readAttributeValue(qName); }
/** * Reads the attribute value. * * @param xmlNamespace The XML namespace. * @param attributeName Name of the attribute * @return Attribute Value * @throws Exception the exception */ public String readAttributeValue(XmlNamespace xmlNamespace, String attributeName) throws Exception { if (xmlNamespace == XmlNamespace.NotSpecified) { return this.readAttributeValue(attributeName); } else { QName qName = new QName(EwsUtilities.getNamespaceUri(xmlNamespace), attributeName); return readAttributeValue(qName); } }
/** * Reads the attribute value. * * @param <T> the generic type * @param cls the cls * @param attributeName the attribute name * @return T * @throws Exception the exception */ public <T> T readAttributeValue(Class<T> cls, String attributeName) throws Exception { return EwsUtilities.parse(cls, this.readAttributeValue(attributeName)); }
/** * Reads a nullable attribute value. * * @param <T> the generic type * @param cls the cls * @param attributeName the attribute name * @return T * @throws Exception the exception */ public <T> T readNullableAttributeValue(Class<T> cls, String attributeName) throws Exception { String attributeValue = this.readAttributeValue(attributeName); if (attributeValue == null) { return null; } else { return EwsUtilities.parse(cls, attributeValue); } }
(reader.getLocalName() .equals(XmlElementNames.DomainSetting))) { String settingClass = reader.readAttributeValue( XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);
throws Exception { AutodiscoverError error = new AutodiscoverError(); error.time = reader.readAttributeValue(XmlAttributeNames.Time); error.id = reader.readAttributeValue(XmlAttributeNames.Id);
(reader.getLocalName() .equals(XmlElementNames.UserSetting))) { String settingClass = reader.readAttributeValue( XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);
/** * Loads web client urls from XML. * * @param reader The reader. * @param webClientUrls The web client urls. * @param elementName Name of the element. * @throws Exception */ private static void loadWebClientUrlsFromXml(EwsXmlReader reader, WebClientUrlCollection webClientUrls, String elementName) throws Exception { do { reader.read(); if (reader.getNodeType().getNodeType() == XmlNodeType.START_ELEMENT) { if (reader.getLocalName().equals(XmlElementNames.OWAUrl)) { String authMethod = reader.readAttributeValue( XmlAttributeNames.AuthenticationMethod); String owaUrl = reader.readElementValue(); WebClientUrl webClientUrl = new WebClientUrl(authMethod, owaUrl); webClientUrls.getUrls().add(webClientUrl); } else { reader.skipCurrentElement(); } } } while (!reader.isEndElement(XmlNamespace.NotSpecified, elementName)); }
/** * Parses the message xml. * * @param reader the reader * @throws Exception the exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ private void parseMessageXml(EwsXmlReader reader) throws Exception, ServiceXmlDeserializationException, Exception { // E14:172881: E12 and E14 return the MessageXml element in different // namespaces (types namespace for E12, errors namespace in E14). To // avoid this problem, the parser will match the namespace from the // start and end elements. XmlNamespace elementNS = EwsUtilities.getNamespaceFromUri(reader.getNamespaceUri()); if (!reader.isEmptyElement()) { do { reader.read(); if (reader.isStartElement() && !reader.isEmptyElement()) { String localName = reader.getLocalName(); if (localName.equals(XmlElementNames.Value)) { this.errorDetails.put(reader .readAttributeValue(XmlAttributeNames.Name), reader.readElementValue()); } } } while (!reader .isEndElement(elementNS, XmlElementNames.MessageXml)); } else { reader.read(); } }
/** * Reads the attribute value. * * @param attributeName Name of the attribute * @return Attribute value. * @throws Exception the exception */ public String readAttributeValue(String attributeName) throws Exception { QName qName = new QName(attributeName); return readAttributeValue(qName); }
/** * Reads the attribute value. * * @param <T> the generic type * @param cls the cls * @param attributeName the attribute name * @return T * @throws Exception the exception */ public <T> T readAttributeValue(Class<T> cls, String attributeName) throws Exception { return EwsUtilities.parse(cls, this.readAttributeValue(attributeName)); }
/** * Reads the attribute value. * * @param xmlNamespace The XML namespace. * @param attributeName Name of the attribute * @return Attribute Value * @throws Exception the exception */ public String readAttributeValue(XmlNamespace xmlNamespace, String attributeName) throws Exception { if (xmlNamespace == XmlNamespace.NotSpecified) { return this.readAttributeValue(attributeName); } else { QName qName = new QName(EwsUtilities.getNamespaceUri(xmlNamespace), attributeName); return readAttributeValue(qName); } }
/** * Reads a nullable attribute value. * * @param <T> the generic type * @param cls the cls * @param attributeName the attribute name * @return T * @throws Exception the exception */ public <T> T readNullableAttributeValue(Class<T> cls, String attributeName) throws Exception { String attributeValue = this.readAttributeValue(attributeName); if (attributeValue == null) { return null; } else { return EwsUtilities.parse(cls, attributeValue); } }
throws Exception { AutodiscoverError error = new AutodiscoverError(); error.time = reader.readAttributeValue(XmlAttributeNames.Time); error.id = reader.readAttributeValue(XmlAttributeNames.Id);
(reader.getLocalName() .equals(XmlElementNames.DomainSetting))) { String settingClass = reader.readAttributeValue( XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);
(reader.getLocalName() .equals(XmlElementNames.UserSetting))) { String settingClass = reader.readAttributeValue( XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);
/** * Loads web client urls from XML. * * @param reader The reader. * @param webClientUrls The web client urls. * @param elementName Name of the element. * @throws Exception */ private static void loadWebClientUrlsFromXml(EwsXmlReader reader, WebClientUrlCollection webClientUrls, String elementName) throws Exception { do { reader.read(); if (reader.getNodeType().getNodeType() == XmlNodeType.START_ELEMENT) { if (reader.getLocalName().equals(XmlElementNames.OWAUrl)) { String authMethod = reader.readAttributeValue( XmlAttributeNames.AuthenticationMethod); String owaUrl = reader.readElementValue(); WebClientUrl webClientUrl = new WebClientUrl(authMethod, owaUrl); webClientUrls.getUrls().add(webClientUrl); } else { reader.skipCurrentElement(); } } } while (!reader.isEndElement(XmlNamespace.NotSpecified, elementName)); }
/** * Parses the message xml. * * @param reader the reader * @throws Exception the exception * @throws ServiceXmlDeserializationException the service xml deserialization exception */ private void parseMessageXml(EwsXmlReader reader) throws Exception, ServiceXmlDeserializationException, Exception { // E14:172881: E12 and E14 return the MessageXml element in different // namespaces (types namespace for E12, errors namespace in E14). To // avoid this problem, the parser will match the namespace from the // start and end elements. XmlNamespace elementNS = EwsUtilities.getNamespaceFromUri(reader.getNamespaceUri()); if (!reader.isEmptyElement()) { do { reader.read(); if (reader.isStartElement() && !reader.isEmptyElement()) { String localName = reader.getLocalName(); if (localName.equals(XmlElementNames.Value)) { this.errorDetails.put(reader .readAttributeValue(XmlAttributeNames.Name), reader.readElementValue()); } } } while (!reader .isEndElement(elementNS, XmlElementNames.MessageXml)); } else { reader.read(); } }