1 7 package org.jboss.axis.message; 8 9 11 import javax.xml.namespace.QName ; 12 import javax.xml.soap.Name ; 13 14 49 public class NameImpl implements Name 50 { 51 52 private QName qname; 53 private String prefix; 54 55 public NameImpl(String local) 56 { 57 this(local, null, null); 58 } 59 60 public NameImpl(String local, String prefix, String uri) 61 { 62 qname = new QName (uri, local); 63 this.prefix = (prefix == null ? "" : prefix); 64 } 65 66 71 public String getLocalName() 72 { 73 return qname.getLocalPart(); 74 } 75 76 82 public String getPrefix() 83 { 84 return prefix; 85 } 86 87 92 public String getQualifiedName() 93 { 94 return prefix + ":" + qname.getLocalPart(); 95 } 96 97 102 public String getURI() 103 { 104 return qname.getNamespaceURI(); 105 } 106 107 public int hashCode() 108 { 109 return qname.hashCode(); 110 } 111 112 116 public boolean equals(Object obj) 117 { 118 if (!(obj instanceof NameImpl)) return false; 119 if (obj == this) return true; 120 NameImpl other = (NameImpl)obj; 121 return qname.equals(other.qname); 122 } 123 124 public String toString() 125 { 126 return qname.toString(); 127 } 128 } 129 | Popular Tags |