Top Description Fields Constructors Methods
org.easymock.internal

public Class InjectionPlan

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, java.util.ArrayList, .HashSet, .List, .Set

Container for mock injections and test subject injection targets.
Author
Alistair Todd
Since
3.3

Field Summary

Modifier and TypeField and Description
private final List<Injection>
private final Set<String>
private final List<Field>
private final List<Injection>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addInjection(Injection
Injection to manage as part of this plan
injection
)

Add an Injection to this container.

public void
addTestSubjectField(Field
Field representing a test subject to which injection of mocks will be attempted
f
)

Add a field that should be treated as a test subject injection target.

private void
public List<Injection>

Returns:

list of Injections having fieldName qualifiers
getQualifiedInjections
()

Get all injections having fieldName qualifiers.

public List<Field>

Returns:

fields representing test subjects
getTestSubjectFields
()

Get fields identified as test subjects to which injection of mocks should be attempted.

public List<Injection>

Returns:

list of Injections that do not have fieldName qualifiers.
getUnqualifiedInjections
()

Get all injections that do not have fieldName qualifiers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

qualifiedInjectionsback to summary
private final List<Injection> qualifiedInjections
qualifiersback to summary
private final Set<String> qualifiers
testSubjectFieldsback to summary
private final List<Field> testSubjectFields
unqualifiedInjectionsback to summary
private final List<Injection> unqualifiedInjections

Constructor Detail

InjectionPlanback to summary
public InjectionPlan()

Method Detail

addInjectionback to summary
public void addInjection(Injection injection)

Add an Injection to this container. It will be managed according to the presence of a fieldName qualifier, and attempting to add an Injection with a duplicate fieldName qualifier will cause an error.

Parameters
injection:Injection

Injection to manage as part of this plan

addTestSubjectFieldback to summary
public void addTestSubjectField(Field f)

Add a field that should be treated as a test subject injection target.

Parameters
f:Field

Field representing a test subject to which injection of mocks will be attempted

blockDuplicateQualifiersback to summary
private void blockDuplicateQualifiers(String qualifier)
getQualifiedInjectionsback to summary
public List<Injection> getQualifiedInjections()

Get all injections having fieldName qualifiers.

Returns:List<Injection>

list of Injections having fieldName qualifiers

getTestSubjectFieldsback to summary
public List<Field> getTestSubjectFields()

Get fields identified as test subjects to which injection of mocks should be attempted.

Returns:List<Field>

fields representing test subjects

getUnqualifiedInjectionsback to summary
public List<Injection> getUnqualifiedInjections()

Get all injections that do not have fieldName qualifiers.

Returns:List<Injection>

list of Injections that do not have fieldName qualifiers.