/* * 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 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.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import org.geotoolkit.sml.xml.AbstractLink; /** * <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 name="source"> * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <attribute name="ref" use="required" type="{http://www.opengis.net/sensorML/1.0.1}linkRef" /> * </restriction> * </complexContent> * </complexType> * </element> * <element name="destination"> * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <attribute name="ref" use="required" type="{http://www.opengis.net/sensorML/1.0.1}linkRef" /> * </restriction> * </complexContent> * </complexType> * </element> * </sequence> * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}anyURI" /> * </restriction> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "source", "destination" }) @XmlRootElement(name = "Link") public class Link extends SensorObject implements AbstractLink { @XmlElement(required = true) private LinkRef source; @XmlElement(required = true) private LinkRef destination; @XmlAttribute @XmlSchemaType(name = "anyURI") private String type; public Link() { } public Link(final AbstractLink link) { if (link != null) { this.type = link.getType(); if (link.getSource() != null) { this.source = new LinkRef(link.getSource().getRef()); } if (link.getDestination() != null) { this.destination = new LinkRef(link.getDestination().getRef()); } } } public Link(final String type, final LinkRef source, final LinkRef destination) { this.destination = destination; this.source = source; this.type = type; } /** * Gets the value of the source property. * * @return * possible object is * {@link Link.Source } * */ public LinkRef getSource() { return source; } /** * Sets the value of the source property. * * @param value * allowed object is * {@link Link.Source } * */ public void setSource(final LinkRef value) { this.source = value; } /** * Gets the value of the destination property. * * @return * possible object is * {@link Link.Destination } * */ public LinkRef getDestination() { return destination; } /** * Sets the value of the destination property. * * @param value * allowed object is * {@link Link.Destination } * */ public void setDestination(final LinkRef value) { this.destination = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(final String value) { this.type = value; } }