|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.beanlib.BeanGetter
public class BeanGetter
Bean Getter.
Field Summary | |
---|---|
static BeanGetter |
inst
Singleton instance. |
private Log |
log
|
Constructor Summary | |
---|---|
private |
BeanGetter()
Singleton. |
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 |
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 |
---|
public static final BeanGetter inst
private final Log log
Constructor Detail |
---|
private BeanGetter()
Method Detail |
---|
public final String getPropertyAsString(Object bean, PropertyDescriptor pd)
public final Map 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 |