1 16 17 package com.sun.org.apache.xerces.internal.util; 18 19 import com.sun.org.apache.xerces.internal.impl.XMLEntityDescription; 20 21 29 public class XMLEntityDescriptionImpl 30 extends XMLResourceIdentifierImpl 31 implements XMLEntityDescription { 32 33 37 38 public XMLEntityDescriptionImpl() {} 40 49 public XMLEntityDescriptionImpl(String entityName, String publicId, String literalSystemId, 50 String baseSystemId, String expandedSystemId) { 51 setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId); 52 } 54 64 public XMLEntityDescriptionImpl(String entityName, String publicId, String literalSystemId, 65 String baseSystemId, String expandedSystemId, String namespace) { 66 setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId, namespace); 67 } 69 73 74 protected String fEntityName; 75 76 80 85 public void setEntityName(String name) { 86 fEntityName = name; 87 } 89 94 public String getEntityName() { 95 return fEntityName; 96 } 98 107 public void setDescription(String entityName, String publicId, String literalSystemId, 108 String baseSystemId, String expandedSystemId) { 109 setDescription(entityName, publicId, literalSystemId, baseSystemId, expandedSystemId, null); 110 } 112 122 public void setDescription(String entityName, String publicId, String literalSystemId, 123 String baseSystemId, String expandedSystemId, String namespace) { 124 fEntityName = entityName; 125 setValues(publicId, literalSystemId, baseSystemId, expandedSystemId, namespace); 126 } 128 131 public void clear() { 132 super.clear(); 133 fEntityName = null; 134 } 136 140 141 public int hashCode() { 142 int code = super.hashCode(); 143 if (fEntityName != null) { 144 code += fEntityName.hashCode(); 145 } 146 return code; 147 } 149 150 public String toString() { 151 StringBuffer str = new StringBuffer (); 152 if (fEntityName != null) { 153 str.append(fEntityName); 154 } 155 str.append(':'); 156 if (fPublicId != null) { 157 str.append(fPublicId); 158 } 159 str.append(':'); 160 if (fLiteralSystemId != null) { 161 str.append(fLiteralSystemId); 162 } 163 str.append(':'); 164 if (fBaseSystemId != null) { 165 str.append(fBaseSystemId); 166 } 167 str.append(':'); 168 if (fExpandedSystemId != null) { 169 str.append(fExpandedSystemId); 170 } 171 str.append(':'); 172 if (fNamespace != null) { 173 str.append(fNamespace); 174 } 175 return str.toString(); 176 } 178 } | Popular Tags |