| Method from org.dom4j.bean.BeanMetaData Detail: |
public int attributeCount() {
return propertyDescriptors.length;
}
|
public BeanAttributeList createAttributeList(BeanElement parent) {
return new BeanAttributeList(parent, this);
}
|
public static BeanMetaData get(Class beanClass) {
BeanMetaData answer = (BeanMetaData) singletonCache.get(beanClass);
if (answer == null) {
answer = new BeanMetaData(beanClass);
singletonCache.put(beanClass, answer);
}
return answer;
}
Static helper method to find and cache meta data objects for bean types |
public Object getData(int index,
Object bean) {
try {
Method method = readMethods[index];
return method.invoke(bean, NULL_ARGS);
} catch (Exception e) {
handleException(e);
return null;
}
}
|
public int getIndex(String name) {
Integer index = (Integer) nameMap.get(name);
return (index != null) ? index.intValue() : (-1);
}
|
public int getIndex(QName qName) {
Integer index = (Integer) nameMap.get(qName);
return (index != null) ? index.intValue() : (-1);
}
|
public QName getQName(int index) {
return qNames[index];
}
|
protected void handleException(Exception e) {
// ignore introspection exceptions
}
|
public void setData(int index,
Object bean,
Object data) {
try {
Method method = writeMethods[index];
Object[] args = {data};
method.invoke(bean, args);
} catch (Exception e) {
handleException(e);
}
}
|