1 28 29 package com.caucho.servlets.webdav; 30 31 34 public class AttributeName { 35 private String prefix; 36 private String namespace; 37 private String local; 38 private String name; 39 40 47 public AttributeName(String uri, String localName, String qName) 48 { 49 this.local = localName; 50 51 int p = qName.indexOf(':'); 52 if (p < 0) 53 prefix = ""; 54 else 55 prefix = qName.substring(0, p); 56 57 this.name = qName; 58 this.namespace = uri; 59 } 60 61 64 public String getName() 65 { 66 return name; 67 } 68 69 72 public String getLocal() 73 { 74 return local; 75 } 76 77 80 public String getPrefix() 81 { 82 return prefix; 83 } 84 85 88 public String getNamespace() 89 { 90 return namespace; 91 } 92 93 public int hashCode() 94 { 95 return local.hashCode() * 65521 + namespace.hashCode(); 96 } 97 98 public boolean equals(Object obj) 99 { 100 if (! (obj instanceof AttributeName)) 101 return false; 102 103 AttributeName name = (AttributeName) obj; 104 105 return local.equals(name.local) && namespace.equals(name.namespace); 106 } 107 108 public String toString() 109 { 110 return "[Name " + name + "]"; 111 } 112 } 113 | Popular Tags |