1 7 8 package javax.naming; 9 10 30 31 public class Binding extends NameClassPair { 32 40 private Object boundObj; 41 42 55 public Binding(String name, Object obj) { 56 super(name, null); 57 this.boundObj = obj; 58 } 59 60 78 public Binding(String name, Object obj, boolean isRelative) { 79 super(name, null, isRelative); 80 this.boundObj = obj; 81 } 82 83 96 public Binding(String name, String className, Object obj) { 97 super(name, className); 98 this.boundObj = obj; 99 } 100 101 119 public Binding(String name, String className, Object obj, boolean isRelative) { 120 super(name, className, isRelative); 121 this.boundObj = obj; 122 } 123 124 132 public String getClassName() { 133 String cname = super.getClassName(); 134 if (cname != null) { 135 return cname; 136 } 137 if (boundObj != null) 138 return boundObj.getClass().getName(); 139 else 140 return null; 141 } 142 143 149 150 public Object getObject() { 151 return boundObj; 152 } 153 154 159 public void setObject(Object obj) { 160 boundObj = obj; 161 } 162 163 173 174 public String toString() { 175 return super.toString() + ":" + getObject(); 176 } 177 178 181 private static final long serialVersionUID = 8839217842691845890L; 182 }; 183 184 | Popular Tags |