1 7 8 package javax.naming; 9 10 35 36 41 42 public class NameClassPair implements java.io.Serializable { 43 51 private String name; 52 53 61 private String className; 62 63 71 private String fullName = null; 72 73 74 85 private boolean isRel = true; 86 87 101 public NameClassPair(String name, String className) { 102 this.name = name; 103 this.className = className; 104 } 105 106 124 public NameClassPair(String name, String className, boolean isRelative) { 125 this.name = name; 126 this.className = className; 127 this.isRel = isRelative; 128 } 129 130 142 public String getClassName() { 143 return className; 144 } 145 146 157 public String getName() { 158 return name; 159 } 160 161 168 public void setName(String name) { 169 this.name = name; 170 } 171 172 182 public void setClassName(String name) { 183 this.className = name; 184 } 185 186 197 public boolean isRelative() { 198 return isRel; 199 } 200 201 211 public void setRelative(boolean r) { 212 isRel = r; 213 } 214 215 237 public String getNameInNamespace() { 238 if (fullName == null) { 239 throw new UnsupportedOperationException (); 240 } 241 return fullName; 242 } 243 244 258 public void setNameInNamespace(String fullName) { 259 this.fullName = fullName; 260 } 261 262 271 public String toString() { 272 return (isRelative() ? "" : "(not relative)") + getName() + ": " + 273 getClassName(); 274 } 275 276 277 280 private static final long serialVersionUID = 5620776610160863339L; 281 } 282 | Popular Tags |