|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.callbackparams.combine.reflect.CallbackRecordsFactory org.callbackparams.combine.annotation.AnnotationAwareCallbackRecordsFactory
public class AnnotationAwareCallbackRecordsFactory
This Java5+ extension to CallbackRecordsFactory
supports
the annotations @CombineConfig
and
@CallbackRecords
. An instance of this class will
be returned by CallbackRecordsFactory.getInstance()
when invoked
inside a Java5+ JVM.
It also sees to that fields that are annotated with
@ParameterizedValue
will be combined and made
available as callback (usually
).
CallbackRecordsFactory.getInstance()
Constructor Summary | |
---|---|
AnnotationAwareCallbackRecordsFactory()
|
Method Summary | |
---|---|
Collection |
collectCallbackRecordsReflectively(Class testClass)
This overridden implementation looks for a method that is annotated with CallbackRecords and returns the records provided by that method. |
protected Map<Field,Class<?>> |
collectValueInjections(Class testClass)
Collects values for the parameterized fields that are to be value-injected. |
protected boolean |
isValueAlsoAvailableAsCallback(Field f)
This overridden method makes sure that a parameter value stays out of the callback-record if its field is annotated with @ParameterizedValue(alsoAvailableAsCallback=false) |
CombineStrategy |
retrieveCombineStrategy(Class testClass)
The default combine strategy is CombineAllPossible2Combinations
but any other strategy could be used by overriding
this class or by using the
@CombineConfig
annotation (if using JDK-1.5+). |
Methods inherited from class org.callbackparams.combine.reflect.CallbackRecordsFactory |
---|
asCombinedArray, findCallbackValuesFactoryClasses, getInstance, isCallbackValuesFactoryClass, retrieveCombinedArray, valuesMethodFor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationAwareCallbackRecordsFactory()
Method Detail |
---|
public CombineStrategy retrieveCombineStrategy(Class testClass)
CallbackRecordsFactory
CombineAllPossible2Combinations
but any other strategy could be used by overriding
this class or by using the
@CombineConfig
annotation (if using JDK-1.5+).
retrieveCombineStrategy
in class CallbackRecordsFactory
public Collection collectCallbackRecordsReflectively(Class testClass)
CallbackRecords
and returns the records provided by that method.
The method must be static or an Error will be thrown.
If there is no such method or if the method is declared in a super-class
and there is a CombineConfig
annotation on a subclass then the
callback-records will instead be determined in the combinatory manner.
If the CallbackRecords
annotated method's class is also annotated
with CombineConfig
then the callback-records will be collected
by both strategies, i.e. combinatory-determined records will be collected
as well as the records returned by the CallbackRecords
method.
collectCallbackRecordsReflectively
in class CallbackRecordsFactory
testClass
- the test class
protected Map<Field,Class<?>> collectValueInjections(Class testClass)
CallbackRecordsFactory
@ParameterizedValue
annotated fields are value-injected.
collectValueInjections
in class CallbackRecordsFactory
Field
to the class, in which to find the values()
method that will
provide the values for this fieldprotected boolean isValueAlsoAvailableAsCallback(Field f)
@ParameterizedValue(alsoAvailableAsCallback=false)
isValueAlsoAvailableAsCallback
in class CallbackRecordsFactory
ParameterizedValue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |