/* * Geotoolkit - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2008 - 2009, 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.sml.xml.v101; 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.XmlID; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.geotoolkit.gml.xml.v311.StringOrRefType; import org.geotoolkit.sml.xml.AbstractDocument; import org.geotoolkit.sml.xml.AbstractOnlineResource; /** * <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/gml}description"/> * <element name="date" type="{http://www.opengis.net/swe/1.0.1}timeIso8601" minOccurs="0"/> * <element ref="{http://www.opengis.net/sensorML/1.0.1}contact" minOccurs="0"/> * <element name="format" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element ref="{http://www.opengis.net/sensorML/1.0.1}onlineResource" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <attribute ref="{http://www.opengis.net/gml}id"/> * <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}token" /> * </restriction> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "description", "date", "contact", "format", "onlineResource" }) @XmlRootElement(name = "Document") public class Document extends SensorObject implements AbstractDocument { @XmlElement(namespace = "http://www.opengis.net/gml", required = true) private StringOrRefType description; private String date; private Contact contact; @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") private String format; private List<OnlineResource> onlineResource; @XmlAttribute(namespace = "http://www.opengis.net/gml") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") private String id; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") private String version; public Document() { } public Document(final AbstractDocument doc) { if (doc != null) { if (doc.getContact() != null) { this.contact = new Contact(doc.getContact()); } this.date = doc.getDate(); this.description = doc.getDescription(); this.format = doc.getFormat(); this.id = doc.getId(); this.version = doc.getVersion(); if (doc.getOnlineResource() != null) { this.onlineResource = new ArrayList<OnlineResource>(); for (AbstractOnlineResource or : doc.getOnlineResource()) { this.onlineResource.add(new OnlineResource(or)); } } } } public Document(final String description) { this.description = new StringOrRefType(description); } public Document(final String description, final String format, final List<OnlineResource> onlineResource) { this.description = new StringOrRefType(description); this.format = format; this.onlineResource = onlineResource; } /** * Gets the value of the description property. * * @return * possible object is * {@link StringOrRefType } * */ public StringOrRefType getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link StringOrRefType } * */ public void setDescription(final StringOrRefType value) { this.description = value; } /** * Gets the value of the date property. * * @return * possible object is * {@link String } * */ public String getDate() { return date; } /** * Sets the value of the date property. * * @param value * allowed object is * {@link String } * */ public void setDate(final String value) { this.date = value; } /** * Person who is responsible for the document * * @return * possible object is * {@link Contact } * */ public Contact getContact() { return contact; } /** * Sets the value of the contact property. * * @param value * allowed object is * {@link Contact } * */ public void setContact(final Contact value) { this.contact = value; } /** * Gets the value of the format property. * * @return * possible object is * {@link String } * */ public String getFormat() { return format; } /** * Sets the value of the format property. * * @param value * allowed object is * {@link String } * */ public void setFormat(final String value) { this.format = value; } /** * Points to the actual document corresponding to that version Gets the value of the onlineResource property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the onlineResource property. * * <p> * For example, to add a new item, do as follows: * <pre> * getOnlineResource().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link OnlineResource } * * */ public List<OnlineResource> getOnlineResource() { if (onlineResource == null) { onlineResource = new ArrayList<OnlineResource>(); } return this.onlineResource; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(final String value) { this.id = value; } /** * 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(final String value) { this.version = value; } }