|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.callbackparams.combine.reflect.CallbackRecordsFactory
public abstract class CallbackRecordsFactory
Factory-class whose main purpose is to create callback-records from reflectively looked-up callback-values factory classes. The default recipe for a callback-values factory is a nested class that has a static array-returning method with the signature 'values()', e.g. a nested enum.
Constructor Summary | |
---|---|
CallbackRecordsFactory()
|
Method Summary | |
---|---|
static Combined[] |
asCombinedArray(Object record)
Utility method that is used by subclasses and the JUnit-3.x utilities. |
Collection |
collectCallbackRecordsReflectively(Class testClass)
This is the method that integration harnesses (such as the CallbackParamsRunner )
should use for retrieving their callback-records in a test-developer
friendly way. |
protected Map |
collectValueInjections(Class testClass)
Collects values for the parameterized fields that are to be value-injected. |
protected Set |
findCallbackValuesFactoryClasses(Class testClass)
Searches the specified class, its super-classes and all implemented interfaces for nested classes that provide callback-values, as defined by isCallbackValuesFactoryClass(java.lang.Class) . |
static CallbackRecordsFactory |
getInstance()
Factory method that returns the implementation suitable for the java-version in use. |
protected boolean |
isCallbackValuesFactoryClass(Class factoryProspect)
The default implementation returns true if the specified class has a static method "values()" that returns an array. |
protected boolean |
isValueAlsoAvailableAsCallback(Field f)
Decides on whether the parameter value will also be available as callback when it is injected to the specified field. |
Combined[] |
retrieveCombinedArray(Class valuesClass)
The returned array (supposedly containing callback-values) is determined from the specified class. |
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+). |
static Method |
valuesMethodFor(Class valuesClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CallbackRecordsFactory()
Method Detail |
---|
public static CallbackRecordsFactory getInstance()
protected Set findCallbackValuesFactoryClasses(Class testClass)
isCallbackValuesFactoryClass(java.lang.Class)
.
protected boolean isCallbackValuesFactoryClass(Class factoryProspect)
public static Method valuesMethodFor(Class valuesClass) throws NoSuchMethodException
NoSuchMethodException
public Combined[] retrieveCombinedArray(Class valuesClass)
public CombineStrategy retrieveCombineStrategy(Class testClass)
CombineAllPossible2Combinations
but any other strategy could be used by overriding
this class or by using the
@CombineConfig
annotation (if using JDK-1.5+).
public Collection collectCallbackRecordsReflectively(Class testClass)
CallbackParamsRunner
)
should use for retrieving their callback-records in a test-developer
friendly way.
testClass
- the test class
protected Map collectValueInjections(Class testClass)
@ParameterizedValue
annotated fields are value-injected.
Field
to the class, in which to find the values()
method that will
provide the values for this fieldprotected boolean isValueAlsoAvailableAsCallback(Field f)
org.callbackparams.annotation.ValueField#alsoAvailableAsCallback()
(when using JDK -1.5+).
public static Combined[] asCombinedArray(Object record)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |