001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.axis2.databinding.types;
020:
021: /**
022: * Custom class for supporting XSD data type NOTATION.
023: *
024: * @see <a href="http://www.w3.org/TR/xmlschema-1/#element-notation">XML Schema Part 1: 3.12
025: * Notation Declarations</a>
026: */
027:
028: public class Notation implements java.io.Serializable {
029:
030: private static final long serialVersionUID = 2393074651972192536L;
031:
032: NCName name;
033: URI publicURI;
034: URI systemURI;
035:
036: public Notation() {
037: }
038:
039: public Notation(NCName name, URI publicURI, URI systemURI) {
040: this .name = name;
041: this .publicURI = publicURI;
042: this .systemURI = systemURI;
043: }
044:
045: public NCName getName() {
046: return name;
047: }
048:
049: public void setName(NCName name) {
050: this .name = name;
051: }
052:
053: public URI getPublic() {
054: return publicURI;
055: }
056:
057: public void setPublic(URI publicURI) {
058: this .publicURI = publicURI;
059: }
060:
061: public URI getSystem() {
062: return systemURI;
063: }
064:
065: public void setSystem(URI systemURI) {
066: this .systemURI = systemURI;
067: }
068:
069: public boolean equals(Object obj) {
070: if (obj == null || !(obj instanceof Notation))
071: return false;
072: Notation other = (Notation) obj;
073: if (name == null) {
074: if (other.name != null) {
075: return false;
076: }
077: } else if (!name.equals(other.name)) {
078: return false;
079: }
080: if (publicURI == null) {
081: if (other.publicURI != null) {
082: return false;
083: }
084: } else if (!publicURI.equals(other.publicURI)) {
085: return false;
086: }
087: if (systemURI == null) {
088: if (other.systemURI != null) {
089: return false;
090: }
091: } else if (!systemURI.equals(other.systemURI)) {
092: return false;
093: }
094: return true;
095: }
096:
097: /**
098: * Returns the sum of the hashcodes of {name,publicURI,systemURI} for whichever properties in
099: * that set is non null. This is consistent with the implementation of equals, as required by
100: * {@link Object#hashCode() Object.hashCode}.
101: *
102: * @return an <code>int</code> value
103: */
104: public int hashCode() {
105: int hash = 0;
106: if (null != name) {
107: hash += name.hashCode();
108: }
109: if (null != publicURI) {
110: hash += publicURI.hashCode();
111: }
112: if (null != systemURI) {
113: hash += systemURI.hashCode();
114: }
115: return hash;
116: }
117:
118: /**
119: * Note - A lot of code that depended on certain descriptions has been deleted from this class
120: */
121:
122: }
|