Package net.sf.jga.fn.property

Provides Functors and Predicates that operate on Java Objects that observe the bean standard naming convention.

See:
          Description

Interface Summary
ArrayBinary.Visitor Interface for classes that may interpret a ArrayBinary predicate.
ArrayUnary.Visitor Interface for classes that may interpret a ArrayUnary predicate.
Cast.Visitor Interface for classes that may interpret a Cast function.
CompareProperty.Visitor Interface for classes that may interpret a CompareProperty predicate.
Construct.Visitor Interface for classes that may interpret a Construct predicate.
ConstructDefault.Visitor Interface for classes that may interpret a ConstructDefault functor.
ConstructUnary.Visitor Interface for classes that may interpret a ConstructUnary predicate.
GetField.Visitor Interface for classes that may interpret a GetField function.
GetProperty.Visitor Interface for classes that may interpret a GetProperty function.
InstanceOf.Visitor Interface for classes that may interpret a InstanceOf function.
Invoke.Visitor Interface for classes that may interpret a InvokeMethod function.
InvokeMethod.Visitor Interface for classes that may interpret a InvokeMethod function.
InvokeNoArgMethod.Visitor Interface for classes that may interpret a InvokeMethod function.
SetField.Visitor Interface for classes that may interpret a SetField function.
SetProperty.Visitor Interface for classes that may interpret a SetProperty function.
 

Class Summary
ArrayBinary<T1,T2> Binary Functor that returns its arguments in a two element array.
ArrayUnary<T> Unary Functor that returns its arguments in a one element array.
Cast<T,R> UnaryFunctor that returns its argument, cast to the given type.
CompareProperty<T,V> Unary Predicate that compares the value of the named property to the given value.
Construct<R> Unary Functor that constructs an object of the given class.
ConstructDefault<R> Generator that constructs an object of the given class using its default constructor.
ConstructUnary<T,R> Unary Functor that constructs an object of the given class via a one-argument constructor.
GetField<T,R> Unary Functor that returns the value of the named field for the argument.
GetProperty<T,R> Unary Functor that returns the value of the named property for the argument.
InstanceOf<T> Functor that returns true if the argument is an instance of given type.
Invoke<R> Functor that invokes a method described at construction and returns the result or null if the result is void.
InvokeMethod<T,R> Functor that invokes a method described at construction and returns the result or null if the result is void.
InvokeNoArgMethod<T,R> Functor that invokes a no-arg method named at construction and returns the result or null if the result is void.
PropertyFunctors Static factory methods for the functors in the Property package.
SetField<T,R> Binary Functor that sets the named field of the first argument to the value.
SetProperty<T,R> Binary Functor that sets the named property of the first argument to the value.
 

Package net.sf.jga.fn.property Description

Provides Functors and Predicates that operate on Java Objects that observe the bean standard naming convention. This is the home for functors that use reflection in construction and/or evaluation.

In previous versions, the constructors used in this package created type-unsafe functors. This was due to an incomplete understanding on my part of the implications of parameterizing the Class class. It's somewhat more obvious to me know how clever this is: it allows the compiler to check that the class given to a method is in fact the same class with which the functor is parameterized. The previous constructors did not take the class of the argument, or they used unparameterized classes as arguments: they typically performed some reflection on the first argument passed to fn(), lazily loading the Method or Constructor on the first call.

In this version, those constructors are deprecated. They are likely to disappear in a future version (unless they prove necessary to the success of some of the project goals).



Copyright © 2002-2006 David A. Hall. All Rights Reserved.