/* * 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.HashMap; import java.util.Map; import java.util.Objects; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; import org.geotoolkit.util.Utilities; /** * * This type is extended by almost all schema types * to allow attributes from other namespaces to be * added to user schemas. * * * <p>Java class for openAttrs complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="openAttrs"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * </restriction> * </complexContent> * </complexType> * </pre> * * * @module */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "openAttrs") @XmlSeeAlso({ Redefine.class, Schema.class, Annotation.class, Annotated.class }) public class OpenAttrs { @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Gets a map that contains attributes that aren't bound to any typed property on this class. */ 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 OpenAttrs) { final OpenAttrs that = (OpenAttrs) object; return Objects.equals(this.otherAttributes, that.otherAttributes); } return false; } @Override public int hashCode() { int hash = 3; 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 (otherAttributes != null && otherAttributes.size() > 0) { sb.append("otherAttributes:\n"); for (QName s : otherAttributes.keySet()) { sb.append(s).append(otherAttributes.get(s)).append('\n'); } } return sb.toString(); } }