/*
* 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.*;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;
/**
* <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 maxOccurs="unbounded" minOccurs="0">
* <any/>
* </sequence>
* <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
* @module
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"content"
})
@XmlRootElement(name = "appinfo")
public class Appinfo {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@XmlAttribute
@XmlSchemaType(name = "anyURI")
protected String source;
@XmlAnyAttribute
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
/**
* Gets the value of the content property.
*
* Objects of the following type(s) are allowed in the list
* {@link String }
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSource(final String value) {
this.source = value;
}
/**
* Gets a map that contains attributes that aren't bound to any typed property on this class.
*
* <p>
* the map is keyed by the name of the attribute and
* the value is the string value of the attribute.
*
* the map returned by this method is live, and you can add new attribute
* by updating the map directly. Because of this design, there's no setter.
*
*
* @return
* always non-null
*/
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
}
/**
* 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 Appinfo) {
final Appinfo that = (Appinfo) object;
return Objects.equals(this.content, that.content) &&
Objects.equals(this.otherAttributes, that.otherAttributes) &&
Objects.equals(this.source, that.source);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 53 * hash + (this.content != null ? this.content.hashCode() : 0);
hash = 53 * hash + (this.source != null ? this.source.hashCode() : 0);
hash = 53 * hash + (this.otherAttributes != null ? this.otherAttributes.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[").append(getClass().getSimpleName()).append('\n');
if (source != null) {
sb.append("source:").append(source).append('\n');
}
if (content != null) {
sb.append("content:\n");
for (Object s : content) {
sb.append(s).append('\n');
}
}
if (otherAttributes != null) {
sb.append("otherAttributes:\n");
for (QName s : otherAttributes.keySet()) {
sb.append(s).append(otherAttributes.get(s)).append('\n');
}
}
return sb.toString();
}
}