|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.beanlib.BeanGetter
public class BeanGetter
Bean Getter.
| Field Summary | |
|---|---|
private org.apache.log4j.Logger |
log
Singleton instance. |
| Constructor Summary | |
|---|---|
BeanGetter()
|
|
| Method Summary | |
|---|---|
private int |
addBeanHashCode(int hashCode,
int delta)
|
private int |
beanReaderHash(int hashCode,
Method m,
Object bean)
Returns a hash code modified from the input hash code with the value returned from a JavaBean reader method using the algorithm suggested in Item 8 of Effective Java by Joshua Bloch. |
int |
getBeanHashCode(Object bean)
Returns a hash code for the given JavaBean object for all the reader methods using the algorithm suggested in Item 8 of Effective Java by Joshua Bloch. |
String |
getPropertyAsString(Object bean,
PropertyDescriptor pd)
Returns the string value of the given property of the specified java bean class. |
Map<String,PropertyDescriptor> |
getPropertyName2DescriptorMap(Class<?> beanClass)
Returns the property name to descriptor map for the given bean class. |
private int |
hashReturnValue(int hashCode,
Class<?> c,
Object v)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final org.apache.log4j.Logger log
| Constructor Detail |
|---|
public BeanGetter()
| Method Detail |
|---|
public final String getPropertyAsString(Object bean,
PropertyDescriptor pd)
public final Map<String,PropertyDescriptor> getPropertyName2DescriptorMap(Class<?> beanClass)
private int beanReaderHash(int hashCode,
Method m,
Object bean)
throws IllegalAccessException,
InvocationTargetException
hashCode - starting hash codem - a JavaBean reader methodbean - JavaNean object
IllegalAccessException
InvocationTargetException
private int hashReturnValue(int hashCode,
Class<?> c,
Object v)
hashCode - hash code value before invoking this methodc - class of value returned from a JavaBean reader methodv - value returned from a JavaBean reader method
private int addBeanHashCode(int hashCode,
int delta)
hashCode - hash code to add todelta - value to be added to the hash code
public int getBeanHashCode(Object bean)
bean - java bean for which the hash code is to be calculated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||