/* * 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.gml.xml.v311; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * A pattern or base for derived types used to specify complex types corresponding to an unspecified UML association - either composition or aggregation. Restricts the cardinality of Objects contained in the association to a maximum of one. An instance of this type can contain an element representing an Object, or serve as a pointer to a remote Object. * * Descendents of this type can be restricted in an application schema to * * allow only specified classes as valid participants in the aggregation * * allow only association by reference (i.e. empty the content model) or by value (i.e. remove the xlinks). * * When used for association by reference, the value of the gml:remoteSchema attribute can be used to locate a schema fragment that constrains the target instance. * * In many cases it is desirable to impose the constraint prohibiting the occurence of both reference and value in the same instance, as that would be ambiguous. This is accomplished by adding a directive in the annotation element of the element declaration. This directive can be in the form of normative prose, or can use a Schematron pattern to automatically constrain co-occurrence - see the declaration for _strictAssociation below. * * If co-occurence is not prohibited, then both a link and content may be present. If this occurs in an instance, then the rule for interpretation is that the instance found by traversing the href provides the normative value of the property, and should be used when possible. The value(s) included as content may be used if the remote instance cannot be resolved. This may be considered to be a "cached" version of the value(s). * * <p>Java class for AssociationType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="AssociationType"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence minOccurs="0"> * <element ref="{http://www.opengis.net/gml}_Object"/> * </sequence> * <attGroup ref="{http://www.opengis.net/gml}AssociationAttributeGroup"/> * </restriction> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AssociationType", propOrder = { "object" }) public class AssociationType { @XmlElementRef(name = "AbstractObject", namespace = "http://www.opengis.net/gml", type = JAXBElement.class) private JAXBElement<?> object; @XmlAttribute(namespace = "http://www.opengis.net/gml") @XmlSchemaType(name = "anyURI") private String remoteSchema; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") private String type; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") private String href; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") private String role; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") @XmlSchemaType(name = "anyURI") private String arcrole; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") private String title; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") private String show; @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") private String actuate; /** * Gets the value of the object property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link OrientableSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link DictionaryType }{@code >} * {@link JAXBElement }{@code <}{@link BaseUnitType }{@code >} * {@link JAXBElement }{@code <}{@link MultiSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link TimePeriodType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometricAggregateType }{@code >} * {@link JAXBElement }{@code <}{@link SolidType }{@code >} * {@link JAXBElement }{@code <}{@link UnitDefinitionType }{@code >} * {@link JAXBElement }{@code <}{@link MultiPointType }{@code >} * {@link JAXBElement }{@code <}{@link SurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link DefinitionProxyType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractMetaDataType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractCurveType }{@code >} * {@link JAXBElement }{@code <}{@link DefinitionType }{@code >} * {@link JAXBElement }{@code <}{@link LinearRingType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeComplexType }{@code >} * {@link JAXBElement }{@code <}{@link PolyhedralSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link CurveType }{@code >} * {@link JAXBElement }{@code <}{@link BagType }{@code >} * {@link JAXBElement }{@code <}{@link FeatureCollectionType }{@code >} * {@link JAXBElement }{@code <}{@link GenericMetaDataType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGMLType }{@code >} * {@link JAXBElement }{@code <}{@link Object }{@code >} * {@link JAXBElement }{@code <}{@link RingType }{@code >} * {@link JAXBElement }{@code <}{@link MultiCurveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometricPrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeObjectType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractSolidType }{@code >} * {@link JAXBElement }{@code <}{@link ArrayType }{@code >} * {@link JAXBElement }{@code <}{@link TinType }{@code >} * {@link JAXBElement }{@code <}{@link MultiGeometryType }{@code >} * {@link JAXBElement }{@code <}{@link LineStringType }{@code >} * {@link JAXBElement }{@code <}{@link ConventionalUnitType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractRingType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link TriangulatedSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractFeatureCollectionType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractFeatureType }{@code >} * {@link JAXBElement }{@code <}{@link MultiLineStringType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometryType }{@code >} * {@link JAXBElement }{@code <}{@link OrientableCurveType }{@code >} * {@link JAXBElement }{@code <}{@link MultiPolygonType }{@code >} * {@link JAXBElement }{@code <}{@link PolygonType }{@code >} * {@link JAXBElement }{@code <}{@link DictionaryType }{@code >} * {@link JAXBElement }{@code <}{@link TimeInstantType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimePrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeGeometricPrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link PointType }{@code >} * {@link JAXBElement }{@code <}{@link MultiSolidType }{@code >} * {@link JAXBElement }{@code <}{@link DerivedUnitType }{@code >} * */ public JAXBElement<?> getObject() { return object; } /** * Sets the value of the object property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link OrientableSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link DictionaryType }{@code >} * {@link JAXBElement }{@code <}{@link BaseUnitType }{@code >} * {@link JAXBElement }{@code <}{@link MultiSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link TimePeriodType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometricAggregateType }{@code >} * {@link JAXBElement }{@code <}{@link SolidType }{@code >} * {@link JAXBElement }{@code <}{@link UnitDefinitionType }{@code >} * {@link JAXBElement }{@code <}{@link MultiPointType }{@code >} * {@link JAXBElement }{@code <}{@link SurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link DefinitionProxyType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractMetaDataType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractCurveType }{@code >} * {@link JAXBElement }{@code <}{@link DefinitionType }{@code >} * {@link JAXBElement }{@code <}{@link LinearRingType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeComplexType }{@code >} * {@link JAXBElement }{@code <}{@link PolyhedralSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link CurveType }{@code >} * {@link JAXBElement }{@code <}{@link BagType }{@code >} * {@link JAXBElement }{@code <}{@link FeatureCollectionType }{@code >} * {@link JAXBElement }{@code <}{@link GenericMetaDataType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGMLType }{@code >} * {@link JAXBElement }{@code <}{@link Object }{@code >} * {@link JAXBElement }{@code <}{@link RingType }{@code >} * {@link JAXBElement }{@code <}{@link MultiCurveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometricPrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeObjectType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractSolidType }{@code >} * {@link JAXBElement }{@code <}{@link ArrayType }{@code >} * {@link JAXBElement }{@code <}{@link TinType }{@code >} * {@link JAXBElement }{@code <}{@link MultiGeometryType }{@code >} * {@link JAXBElement }{@code <}{@link LineStringType }{@code >} * {@link JAXBElement }{@code <}{@link ConventionalUnitType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractRingType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link TriangulatedSurfaceType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractFeatureCollectionType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractFeatureType }{@code >} * {@link JAXBElement }{@code <}{@link MultiLineStringType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractGeometryType }{@code >} * {@link JAXBElement }{@code <}{@link OrientableCurveType }{@code >} * {@link JAXBElement }{@code <}{@link MultiPolygonType }{@code >} * {@link JAXBElement }{@code <}{@link PolygonType }{@code >} * {@link JAXBElement }{@code <}{@link DictionaryType }{@code >} * {@link JAXBElement }{@code <}{@link TimeInstantType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimePrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link AbstractTimeGeometricPrimitiveType }{@code >} * {@link JAXBElement }{@code <}{@link PointType }{@code >} * {@link JAXBElement }{@code <}{@link MultiSolidType }{@code >} * {@link JAXBElement }{@code <}{@link DerivedUnitType }{@code >} * */ public void setObject(final JAXBElement<?> value) { this.object = ((JAXBElement<?> ) value); } /** * Gets the value of the remoteSchema property. * * @return * possible object is * {@link String } * */ public String getRemoteSchema() { return remoteSchema; } /** * Sets the value of the remoteSchema property. * * @param value * allowed object is * {@link String } * */ public void setRemoteSchema(final String value) { this.remoteSchema = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { if (type == null) { return "simple"; } else { 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; } /** * Gets the value of the href property. * * @return * possible object is * {@link String } * */ public String getHref() { return href; } /** * Sets the value of the href property. * * @param value * allowed object is * {@link String } * */ public void setHref(final String value) { this.href = value; } /** * Gets the value of the role property. * * @return * possible object is * {@link String } * */ public String getRole() { return role; } /** * Sets the value of the role property. * * @param value * allowed object is * {@link String } * */ public void setRole(final String value) { this.role = value; } /** * Gets the value of the arcrole property. * * @return * possible object is * {@link String } * */ public String getArcrole() { return arcrole; } /** * Sets the value of the arcrole property. * * @param value * allowed object is * {@link String } * */ public void setArcrole(final String value) { this.arcrole = value; } /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(final String value) { this.title = value; } /** * Gets the value of the show property. * * @return * possible object is * {@link String } * */ public String getShow() { return show; } /** * Sets the value of the show property. * * @param value * allowed object is * {@link String } * */ public void setShow(final String value) { this.show = value; } /** * Gets the value of the actuate property. * * @return * possible object is * {@link String } * */ public String getActuate() { return actuate; } /** * Sets the value of the actuate property. * * @param value * allowed object is * {@link String } * */ public void setActuate(final String value) { this.actuate = value; } @Override public String toString() { StringBuilder sb = new StringBuilder("[").append(this.getClass().getSimpleName()).append("]\n"); if (object != null) { sb.append("object:").append(object.getValue()).append('\n'); } if (remoteSchema != null) { sb.append("remoteSchema: ").append(remoteSchema).append('\n'); } if (actuate != null) { sb.append("actuate: ").append(actuate).append('\n'); } if (arcrole != null) { sb.append("actuate: ").append(arcrole).append('\n'); } if (href != null) { sb.append("href: ").append(href).append('\n'); } if (role != null) { sb.append("role: ").append(role).append('\n'); } if (show != null) { sb.append("show: ").append(show).append('\n'); } if (title != null) { sb.append("title: ").append(title).append('\n'); } if (type != null) { sb.append("type: ").append(type).append('\n'); } return sb.toString(); } }