microsoft.exchange.webservices.data.GetServerTimeZonesResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exchange-ws-api Show documentation
Show all versions of exchange-ws-api Show documentation
The source came from http://archive.msdn.microsoft.com/ewsjavaapi
Support for Maven has been added.
The newest version!
/**************************************************************************
* copyright file="GetServerTimeZonesResponse.java" company="Microsoft"
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Defines the GetServerTimeZonesResponse.java.
**************************************************************************/
package microsoft.exchange.webservices.data;
import java.util.ArrayList;
import java.util.Collection;
import javax.xml.stream.XMLStreamException;
/**
* Represents the response to a GetServerTimeZones request.
*/
class GetServerTimeZonesResponse extends ServiceResponse {
/** The time zones. */
private Collection timeZones =
new ArrayList();
/**
* Initializes a new instance of the class.
*/
protected GetServerTimeZonesResponse() {
super();
}
/**
* Reads response elements from XML.
*
* @param reader
* the reader
* @throws ServiceXmlDeserializationException
* the service xml deserialization exception
* @throws XMLStreamException
* the xML stream exception
* @throws InstantiationException
* the instantiation exception
* @throws IllegalAccessException
* the illegal access exception
* @throws ServiceLocalException
* the service local exception
* @throws Exception
* the exception
*/
@Override
protected void readElementsFromXml(EwsServiceXmlReader reader)
throws ServiceXmlDeserializationException, XMLStreamException,
InstantiationException, IllegalAccessException,
ServiceLocalException, Exception {
super.readElementsFromXml(reader);
reader.readStartElement(XmlNamespace.Messages,
XmlElementNames.TimeZoneDefinitions);
if (!reader.isEmptyElement()) {
do {
reader.read();
if (reader.isStartElement(XmlNamespace.Types,
XmlElementNames.TimeZoneDefinition)) {
TimeZoneDefinition timeZoneDefinition =
new TimeZoneDefinition();
timeZoneDefinition.loadFromXml(reader);
this.timeZones.add(timeZoneDefinition);
}
} while (!reader.isEndElement(XmlNamespace.Messages,
XmlElementNames.TimeZoneDefinitions));
} else {
reader.read();
}
}
/**
* Reads response elements from XML.
*
* @return the time zones
*/
public Collection getTimeZones() {
return this.timeZones;
}
}