net.sf.beanlib.provider
Class BeanChecker
java.lang.Object
net.sf.beanlib.provider.BeanChecker
public class BeanChecker
- extends Object
Bean Checker.
- Author:
- Joe D. Velopar
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inst
public static final BeanChecker inst
- Singleton instance.
log
private final Log log
BeanChecker
private BeanChecker()
- Singleton.
empty
public boolean empty(Object fromBean,
Class k)
- Returns true if the fromBean is empty; or false otherwise.
It is considered empty if every publicly declared getter methods of the specified class
either return null or blank string.
- Parameters:
fromBean
- java bean to check if empty or not.k
- specified class name from which the getter methods are derived.
beanEquals
public boolean beanEquals(Object fBean,
Object tBean)
- Parameters:
fBean
- from beantBean
- to bean
- Returns:
- true if the two beans are equal in a JavaBean sense.
ie. if they have the same number of properties,
and the properties that can be read contain the same values.
TODO: unit test me