1 57 58 package com.sun.org.apache.xerces.internal.util; 59 60 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; 61 62 71 public class XMLResourceIdentifierImpl 72 implements XMLResourceIdentifier { 73 74 78 79 protected String fPublicId; 80 81 82 protected String fLiteralSystemId; 83 84 85 protected String fBaseSystemId; 86 87 88 protected String fExpandedSystemId; 89 90 91 protected String fNamespace; 92 93 97 98 public XMLResourceIdentifierImpl() {} 100 108 public XMLResourceIdentifierImpl(String publicId, 109 String literalSystemId, String baseSystemId, 110 String expandedSystemId) { 111 setValues(publicId, literalSystemId, baseSystemId, 112 expandedSystemId, null); 113 } 115 124 public XMLResourceIdentifierImpl(String publicId, String literalSystemId, 125 String baseSystemId, String expandedSystemId, 126 String namespace) { 127 setValues(publicId, literalSystemId, baseSystemId, 128 expandedSystemId, namespace); 129 } 131 135 136 public void setValues(String publicId, String literalSystemId, 137 String baseSystemId, String expandedSystemId) { 138 setValues(publicId, literalSystemId, baseSystemId, 139 expandedSystemId, null); 140 } 142 143 public void setValues(String publicId, String literalSystemId, 144 String baseSystemId, String expandedSystemId, 145 String namespace) { 146 fPublicId = publicId; 147 fLiteralSystemId = literalSystemId; 148 fBaseSystemId = baseSystemId; 149 fExpandedSystemId = expandedSystemId; 150 fNamespace = namespace; 151 } 153 154 public void clear() { 155 fPublicId = null; 156 fLiteralSystemId = null; 157 fBaseSystemId = null; 158 fExpandedSystemId = null; 159 fNamespace = null; 160 } 162 163 public void setPublicId(String publicId) { 164 fPublicId = publicId; 165 } 167 168 public void setLiteralSystemId(String literalSystemId) { 169 fLiteralSystemId = literalSystemId; 170 } 172 173 public void setBaseSystemId(String baseSystemId) { 174 fBaseSystemId = baseSystemId; 175 } 177 178 public void setExpandedSystemId(String expandedSystemId) { 179 fExpandedSystemId = expandedSystemId; 180 } 182 183 public void setNamespace(String namespace) { 184 fNamespace = namespace; 185 } 187 191 192 public String getPublicId() { 193 return fPublicId; 194 } 196 197 public String getLiteralSystemId() { 198 return fLiteralSystemId; 199 } 201 204 public String getBaseSystemId() { 205 return fBaseSystemId; 206 } 208 209 public String getExpandedSystemId() { 210 return fExpandedSystemId; 211 } 213 214 public String getNamespace() { 215 return fNamespace; 216 } 218 222 223 public int hashCode() { 224 int code = 0; 225 if (fPublicId != null) { 226 code += fPublicId.hashCode(); 227 } 228 if (fLiteralSystemId != null) { 229 code += fLiteralSystemId.hashCode(); 230 } 231 if (fBaseSystemId != null) { 232 code += fBaseSystemId.hashCode(); 233 } 234 if (fExpandedSystemId != null) { 235 code += fExpandedSystemId.hashCode(); 236 } 237 if (fNamespace != null) { 238 code += fNamespace.hashCode(); 239 } 240 return code; 241 } 243 244 public String toString() { 245 StringBuffer str = new StringBuffer (); 246 if (fPublicId != null) { 247 str.append(fPublicId); 248 } 249 str.append(':'); 250 if (fLiteralSystemId != null) { 251 str.append(fLiteralSystemId); 252 } 253 str.append(':'); 254 if (fBaseSystemId != null) { 255 str.append(fBaseSystemId); 256 } 257 str.append(':'); 258 if (fExpandedSystemId != null) { 259 str.append(fExpandedSystemId); 260 } 261 str.append(':'); 262 if (fNamespace != null) { 263 str.append(fNamespace); 264 } 265 return str.toString(); 266 } 268 } | Popular Tags |