/*
* 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.xsd.xml.v2001;
import java.util.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
*
* This type is extended by all types which allow annotation
* other than <schema> itself
*
*
* <p>Java class for annotated complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="annotated">
* <complexContent>
* <extension base="{http://www.w3.org/2001/XMLSchema}openAttrs">
* <sequence>
* <element ref="{http://www.w3.org/2001/XMLSchema}annotation" minOccurs="0"/>
* </sequence>
* <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "annotated", propOrder = {
"annotation"
})
@XmlSeeAlso({
ExtensionType.class,
Element.class,
AttributeGroup.class,
ComplexType.class,
Attribute.class,
RestrictionType.class,
SimpleType.class,
Group.class,
SimpleContent.class,
List.class,
Restriction.class,
Facet.class,
Wildcard.class,
Union.class,
Notation.class,
Import.class,
Include.class,
Field.class,
Keybase.class,
ComplexContent.class,
Selector.class
})
public class Annotated extends OpenAttrs {
private Annotation annotation;
@XmlAttribute
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
private String id;
/**
* Gets the value of the annotation property.
*
* @return
* possible object is
* {@link Annotation }
*
*/
public Annotation getAnnotation() {
return annotation;
}
/**
* Sets the value of the annotation property.
*
* @param value
* allowed object is
* {@link Annotation }
*
*/
public void setAnnotation(final Annotation value) {
this.annotation = value;
}
/**
* 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;
}
/**
* Verify if this entry is identical to the specified object.
*/
@Override
public boolean equals(final Object object) {
if (object == this) {
return true;
}
if (object instanceof Annotated && super.equals(object)) {
final Annotated that = (Annotated) object;
return Objects.equals(this.annotation, that.annotation) &&
Objects.equals(this.id , that.id);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 83 * hash + (this.annotation != null ? this.annotation.hashCode() : 0);
hash = 83 * hash + (this.id != null ? this.id.hashCode() : 0);
return hash;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder(super.toString()).append('\n');
if (id != null) {
sb.append("id:").append(id).append('\n');
}
if (annotation != null) {
sb.append("annotation:").append(annotation).append('\n');
}
return sb.toString();
}
}