Provides Functors and Predicates that operate on Java Objects that observe the bean standard naming convention.
See: Description
Interface Summary | |
---|---|
CompareProperty.Visitor | Interface for classes that may interpret a CompareProperty predicate. |
ConstructUnary.Visitor | Interface for classes that may interpret a ConstructUnary predicate. |
GetProperty.Visitor | Interface for classes that may interpret a GetProperty function. |
GetPropertyFn.Visitor | Interface for classes that may interpret a GetPropertyFn function. |
PropertyCompare.Visitor | Interface for classes that may interpret a PropertyCompare predicate. |
SetProperty.Visitor | Interface for classes that may interpret a SetProperty function. |
SetPropertyFn.Visitor | Interface for classes that may interpret a SetPropertyFn function. |
Class Summary | |
---|---|
CompareProperty<T,V> | Unary Predicate that compares the value of the named property to the given value. |
ConstructUnary<T,R> | Unary Predicate that constructs an object of the given class via a one-argument constructor. |
GetProperty<T,R> | Unary Functor that returns the value of the named property for the argument. |
GetPropertyFn<T,R> | Deprecated name: use GetProperty instead. |
PropertyCompare<T,V> | Deprecated name: use CompareProperty instead. |
SetProperty<T,R> | Binary Functor that sets the named property of the first argument to the value. |
SetPropertyFn<T,R> | Deprecated name: use SetProperty instead. |
Note that many of these functors are not entirely type-safe: the interaction between generics and reflection in java is somewhat hands-off. There is no way, for example, to check that the type that is used at declaration of one of these functors is compatable with a class object passed to its constructor. If there is a discrepency between the two, the class object will generally take precedence (ie, the class object is used at runtime to perform reflective operations, and the type used at declaration is not known at runtime).
It is up to the user to ensure that the class passed to the constructor of one of these functors is correct. The best way to ensure this may be to not cast the results of functor evaluation (the runtime will throw ClassCastException in this case -- this will generally be detected during testing of the application. (See the testConstructClassMismatch in TestConstructUnary for an example of this).