public class SetterConfiguration extends Object
Constructor and Description |
---|
SetterConfiguration(Class aClass)
Constructs the setter configuration.
|
Modifier and Type | Method and Description |
---|---|
SetterConfiguration |
add(String aName)
Adds a given setter name to the setters.
|
SetterConfiguration |
addSetter(Class aType)
Adds a given setter identified by the type it accepts to the list of
setters.N
|
SetterConfiguration |
clear()
Removes all setters.
|
static List<Method> |
getAllSetters(Class aClass,
boolean aPublicOnly)
Gets all setters for the current class.
|
List<RequiredInterface> |
getRequiredInterfaces()
Gets the required interfaces based on the configured setteres.
|
List<Method> |
getSetters() |
SetterConfiguration |
initAllSetters()
Makes sure that all available setters are used.
|
void |
inject(Scope aScope,
Object aObject)
Invokes all configured setters with the appropriate values.
|
SetterConfiguration |
remove(Method aMethod)
Removes the method from the set of methods.
|
SetterConfiguration |
remove(String aName)
Removes a setter from the set of methods.
|
SetterConfiguration |
setNonPublic(boolean aIsNonPublic)
Called to set whether non-public setters are also used.
|
ParameterValues |
values(String aMethod)
Returns the parameter values for allowing detailed configuration of how
parameter values are set.
|
public SetterConfiguration(Class aClass)
aClass
- Class which is being configured.public SetterConfiguration initAllSetters()
public SetterConfiguration setNonPublic(boolean aIsNonPublic)
aIsNonPublic
- Non public flag.public SetterConfiguration clear()
public SetterConfiguration remove(String aName)
aName
- Name of the setter to remove.public SetterConfiguration remove(Method aMethod)
aMethod
- Method to remove.public SetterConfiguration add(String aName)
aName
- Name of a setter method.public SetterConfiguration addSetter(Class aType)
aType
- Type to look for. Note that this must be the exact type as
autoboxing and autounboxing is not used.IllegalArgumentException
- In case no setter is found or multiple setters are found.public static List<Method> getAllSetters(Class aClass, boolean aPublicOnly)
public List<RequiredInterface> getRequiredInterfaces()
public void inject(Scope aScope, Object aObject)
aScope
- Scope within which invocation takes place.aObject
- Object on which the invocation takes place.public ParameterValues values(String aMethod)
aMethod
- Setter name without the "set" prefix with the first character
converted to lower case.Copyright © 2022. All rights reserved.