Methods Summary |
---|
public void | addExtraAttribute(java.lang.String name, java.lang.Object value)Add a new dynamic attribte
if (value==null) {
return;
}
if (dynamicAttributes == null) {
dynamicAttributes = new Hashtable();
}
dynamicAttributes.put(name, value);
changed();
|
private void | changed()notify our observers we have changed
setChanged();
notifyObservers();
|
public java.lang.Object | getExtraAttribute(java.lang.String name)Obtain a dynamic attribute from the repository
if (dynamicAttributes == null) {
return null;
}
return dynamicAttributes.get(name);
|
public java.util.Map | getExtraAttributes()Direct acess to the dynamic attributes repository
if (dynamicAttributes == null) {
dynamicAttributes = new Hashtable();
}
return dynamicAttributes;
|
public void | print(java.lang.StringBuffer toStringBuffer)
if (dynamicAttributes==null) {
toStringBuffer.append("<== No attribute ==>");
} else {
toStringBuffer.append("==>Dynamic Attribute");
Set keys = dynamicAttributes.keySet();
for (Iterator itr = keys.iterator();itr.hasNext();) {
String keyName = (String) itr.next();
Object o = getExtraAttribute(keyName);
if (o instanceof Object[]) {
Object[] objects = (Object[]) o;
for (int i=0;i<objects.length;i++) {
toStringBuffer.append("\n Indexed prop name ").append(keyName).append("[").append(i).append("] = ");
if(objects[i] instanceof DynamicAttributesDescriptor)
((DynamicAttributesDescriptor)objects[i]).print(toStringBuffer);
else
toStringBuffer.append(objects[i]);
}
} else {
toStringBuffer.append("\n Property name = ").append(keyName).append(" value = ");
if(o instanceof DynamicAttributesDescriptor)
((DynamicAttributesDescriptor)o).print(toStringBuffer);
else
toStringBuffer.append(o);
}
}
toStringBuffer.append("\n<==End");
return ;
}
|
public void | removeExtraAttribute(java.lang.String name)Removes a dynamic attribute from the repository
if (dynamicAttributes == null) {
return;
}
dynamicAttributes.remove(name);
changed();
|
public java.lang.String | toString()
StringBuffer toStringBuf = new StringBuffer();
this.print(toStringBuf);
return toStringBuf.toString();
|