/*
* Geotoolkit - An Open Source Java GIS Toolkit
* http://www.geotoolkit.org
*
* (C) 2013, Geomatys
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package org.geotoolkit.ows.xml.v200;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.geotoolkit.ows.xml.ExceptionResponse;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.opengis.net/ows/2.0}Exception" maxOccurs="unbounded"/>
* </sequence>
* <attribute name="version" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <pattern value="\d+\.\d?\d\.\d?\d"/>
* </restriction>
* </simpleType>
* </attribute>
* <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"exception"
})
@XmlRootElement(name = "ExceptionReport")
public class ExceptionReport implements ExceptionResponse{
@XmlElement(name = "Exception", required = true)
private List<ExceptionType> exception;
@XmlAttribute(required = true)
private String version;
@XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
private String lang;
/**
* Empty constructor used by JAXB.
*/
ExceptionReport() {}
/**
* Build a new full exception with the specified text, code and locator.
*
* @param exceptionText
* @param exceptionCode
*/
public ExceptionReport(final String exceptionText, final String exceptionCode, final String locator, final String version) {
exception = new ArrayList<>();
this.exception.add(new ExceptionType(exceptionText, exceptionCode, locator));
this.version = version;
}
/**
* Unordered list of one or more Exception elements
* that each describes an error. These Exception elements shall be
* interpreted by clients as being independent of one another (not
* hierarchical).Gets the value of the exception property.
*
*/
public List<ExceptionType> getException() {
if (exception == null) {
exception = new ArrayList<>();
}
return this.exception;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Identifier of the language used by all included
* exception text values. These language identifiers shall be as
* specified in IETF RFC 4646. When this attribute is omitted, the
* language used is not identified.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLang() {
return lang;
}
/**
* Sets the value of the lang property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLang(String value) {
this.lang = value;
}
}