/** * Parses the specified value. * * @param value The value * @return Double value from parsed value. * @throws java.text.ParseException * @throws IllegalAccessException * @throws InstantiationException */ @Override protected TPropertyValue parse(String value) throws InstantiationException, IllegalAccessException, ParseException { return EwsUtilities.parse(instance, value); }
/** * 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()); }
/** * 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); } }
/** * Tries to read Status or Mailbox elements from XML. * * @param reader the reader * @return True if element was read. * @throws Exception the exception */ public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception { if (reader.getLocalName().equals(XmlElementNames.Status)) { this.status = EwsUtilities.parse(MemberStatus.class, reader .readElementValue()); return true; } else if (reader.getLocalName().equals(XmlElementNames.Mailbox)) { this.setAddressInformation(new EmailAddress()); this.getAddressInformation().loadFromXml(reader, reader.getLocalName()); return true; } else { return false; } }
/** * Parses the specified value. * * @param value The value * @return Double value from parsed value. * @throws java.text.ParseException * @throws IllegalAccessException * @throws InstantiationException */ @Override protected TPropertyValue parse(String value) throws InstantiationException, IllegalAccessException, ParseException { return EwsUtilities.parse(instance, value); }
/** * Reads the attribute from XML. * * @param reader accepts EwsServiceXmlReader * @throws Exception throws Exception */ @Override public void readAttributesFromXml(EwsServiceXmlReader reader) throws Exception { super.readAttributesFromXml(reader); this.getEmailAddress().setName( reader.readAttributeValue(XmlAttributeNames.Name)); this .getEmailAddress() .setRoutingType( reader .readAttributeValue(XmlAttributeNames. RoutingType)); String mailboxTypeString = reader .readAttributeValue(XmlAttributeNames.MailboxType); if ((mailboxTypeString != null) && (!mailboxTypeString.isEmpty())) { this.getEmailAddress().setMailboxType( EwsUtilities.parse(MailboxType.class, mailboxTypeString)); } else { this.getEmailAddress().setMailboxType(null); } }
/** * 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 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()); }
/** * 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); } }
/** * Tries to read Status or Mailbox elements from XML. * * @param reader the reader * @return True if element was read. * @throws Exception the exception */ public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception { if (reader.getLocalName().equals(XmlElementNames.Status)) { this.status = EwsUtilities.parse(MemberStatus.class, reader .readElementValue()); return true; } else if (reader.getLocalName().equals(XmlElementNames.Mailbox)) { this.setAddressInformation(new EmailAddress()); this.getAddressInformation().loadFromXml(reader, reader.getLocalName()); return true; } else { return false; } }
/** * Reads the attribute from XML. * * @param reader accepts EwsServiceXmlReader * @throws Exception throws Exception */ @Override public void readAttributesFromXml(EwsServiceXmlReader reader) throws Exception { super.readAttributesFromXml(reader); this.getEmailAddress().setName( reader.readAttributeValue(XmlAttributeNames.Name)); this .getEmailAddress() .setRoutingType( reader .readAttributeValue(XmlAttributeNames. RoutingType)); String mailboxTypeString = reader .readAttributeValue(XmlAttributeNames.MailboxType); if ((mailboxTypeString != null) && (!mailboxTypeString.isEmpty())) { this.getEmailAddress().setMailboxType( EwsUtilities.parse(MailboxType.class, mailboxTypeString)); } else { this.getEmailAddress().setMailboxType(null); } }