| Method from org.apache.commons.modeler.AttributeInfo Detail: |
public ModelMBeanAttributeInfo createAttributeInfo() {
// Return our cached information (if any)
if (info != null)
return (info);
if((getMethodObj != null) || (setMethodObj != null) ) {
try {
info=new ModelMBeanAttributeInfo(getName(), getDescription(),
getMethodObj, setMethodObj);
return info;
} catch( Exception ex) {
ex.printStackTrace();
}
}
// Create and return a new information object
info = new ModelMBeanAttributeInfo
(getName(), getType(), getDescription(),
isReadable(), isWriteable(), false);
Descriptor descriptor = info.getDescriptor();
if (getDisplayName() != null)
descriptor.setField("displayName", getDisplayName());
if (isReadable()) {
if (getGetMethod() != null)
descriptor.setField("getMethod", getGetMethod());
else
descriptor.setField("getMethod",
getMethodName(getName(), true, isIs()));
}
if (isWriteable()) {
if (getSetMethod() != null)
descriptor.setField("setMethod", getSetMethod());
else
descriptor.setField("setMethod",
getMethodName(getName(), false, false));
}
addFields(descriptor);
info.setDescriptor(descriptor);
return (info);
}
Create and return a ModelMBeanAttributeInfo object that
corresponds to the attribute described by this instance. |
public String getDefault() {
return defaultStringValue;
}
Default value. If set, it can provide info to the user and
it can be used by persistence mechanism to generate a more compact
representation ( a value may not be saved if it's default ) |
public String getDisplayName() {
return (this.displayName);
}
The display name of this attribute. |
public String getGetMethod() {
return (this.getMethod);
}
The name of the property getter method, if non-standard. |
public Method getGetMethodObj() {
return getMethodObj;
}
|
public String getPersist() {
return persist;
}
Persistence policy.
All persistent attributes should have this attribute set.
Valid values:
??? |
public String getSetMethod() {
return (this.setMethod);
}
The name of the property setter method, if non-standard. |
public Method getSetMethodObj() {
return setMethodObj;
}
|
public String getType() {
return (this.type);
}
The fully qualified Java class name of this attribute. |
public boolean isIs() {
return (this.is);
}
Is this a boolean attribute with an "is" getter? |
public boolean isReadable() {
return (this.readable);
}
Is this attribute readable by management applications? |
public boolean isWriteable() {
return (this.writeable);
}
Is this attribute writeable by management applications? |
public void setDefault(String defaultStringValue) {
this.defaultStringValue = defaultStringValue;
}
|
public void setDescription(String description) {
// ------------------------------------------------------------- Properties
super.setDescription(description);
this.info = null;
}
Override the description property setter. |
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
|
public void setGetMethod(String getMethod) {
this.getMethod = getMethod;
this.info = null;
}
|
public void setGetMethodObj(Method getMethodObj) {
this.getMethodObj = getMethodObj;
}
|
public void setIs(boolean is) {
this.is = is;
this.info = null;
}
|
public void setName(String name) {
super.setName(name);
this.info = null;
}
Override the name property setter. |
public void setPersist(String persist) {
this.persist = persist;
}
|
public void setReadable(boolean readable) {
this.readable = readable;
this.info = null;
}
|
public void setSetMethod(String setMethod) {
this.setMethod = setMethod;
this.info = null;
}
|
public void setSetMethodObj(Method setMethodObj) {
this.setMethodObj = setMethodObj;
}
|
public void setType(String type) {
this.type = type;
this.info = null;
}
|
public void setWriteable(boolean writeable) {
this.writeable = writeable;
this.info = null;
}
|
public String toString() {
StringBuffer sb = new StringBuffer("AttributeInfo[");
sb.append("name=");
sb.append(name);
sb.append(", description=");
sb.append(description);
if (!readable) {
sb.append(", readable=");
sb.append(readable);
}
sb.append(", type=");
sb.append(type);
if (!writeable) {
sb.append(", writeable=");
sb.append(writeable);
}
sb.append("]");
return (sb.toString());
}
Return a string representation of this attribute descriptor. |