| java.lang.Object org.springframework.beans.factory.config.ConstructorArgumentValues
ConstructorArgumentValues | public class ConstructorArgumentValues (Code) | | Holder for constructor argument values, typically as part of a bean definition.
Supports values for a specific index in the constructor argument list
as well as for generic argument matches by type.
author: Juergen Hoeller since: 09.11.2003 See Also: BeanDefinition.getConstructorArgumentValues |
Method Summary | |
public void | addArgumentValues(ConstructorArgumentValues other) Copy all given argument values into this object, using separate holder
instances to keep the values independent from the original object.
Note: Identical ValueHolder instances will only be registered once,
to allow for merging and re-merging of argument value definitions. | public void | addGenericArgumentValue(Object value) Add generic argument value to be matched by type. | public void | addGenericArgumentValue(Object value, String type) Add generic argument value to be matched by type. | public void | addGenericArgumentValue(ValueHolder newValue) Add generic argument value to be matched by type.
Note: A single generic argument value will just be used once,
rather than matched multiple times (as of Spring 1.1).
Parameters: newValue - the argument value in the form of a ValueHolder Note: Identical ValueHolder instances will only be registered once,to allow for merging and re-merging of argument value definitions. | public void | addIndexedArgumentValue(int index, Object value) Add argument value for the given index in the constructor argument list. | public void | addIndexedArgumentValue(int index, Object value, String type) Add argument value for the given index in the constructor argument list. | public void | addIndexedArgumentValue(int index, ValueHolder newValue) Add argument value for the given index in the constructor argument list. | public void | clear() Clear this holder, removing all argument values. | public boolean | equals(Object other) | public int | getArgumentCount() Return the number of argument values held in this instance,
counting both indexed and generic argument values. | public ValueHolder | getArgumentValue(int index, Class requiredType) Look for an argument value that either corresponds to the given index
in the constructor argument list or generically matches by type. | public ValueHolder | getArgumentValue(int index, Class requiredType, Set usedValueHolders) Look for an argument value that either corresponds to the given index
in the constructor argument list or generically matches by type. | public ValueHolder | getGenericArgumentValue(Class requiredType) Look for a generic argument value that matches the given type. | public ValueHolder | getGenericArgumentValue(Class requiredType, Set usedValueHolders) Look for the next generic argument value that matches the given type,
ignoring argument values that have already been used in the current
resolution process. | public List | getGenericArgumentValues() Return the list of generic argument values. | public ValueHolder | getIndexedArgumentValue(int index, Class requiredType) Get argument value for the given index in the constructor argument list. | public Map | getIndexedArgumentValues() Return the map of indexed argument values. | public int | hashCode() | public boolean | isEmpty() Return if this holder does not contain any argument values,
neither indexed ones nor generic ones. |
ConstructorArgumentValues | public ConstructorArgumentValues()(Code) | | Create a new empty ConstructorArgumentValues object.
|
ConstructorArgumentValues | public ConstructorArgumentValues(ConstructorArgumentValues original)(Code) | | Deep copy constructor.
Parameters: original - the ConstructorArgumentValues to copy |
addArgumentValues | public void addArgumentValues(ConstructorArgumentValues other)(Code) | | Copy all given argument values into this object, using separate holder
instances to keep the values independent from the original object.
Note: Identical ValueHolder instances will only be registered once,
to allow for merging and re-merging of argument value definitions. Distinct
ValueHolder instances carrying the same content are of course allowed.
|
addGenericArgumentValue | public void addGenericArgumentValue(Object value)(Code) | | Add generic argument value to be matched by type.
Note: A single generic argument value will just be used once,
rather than matched multiple times (as of Spring 1.1).
Parameters: value - the argument value |
addGenericArgumentValue | public void addGenericArgumentValue(Object value, String type)(Code) | | Add generic argument value to be matched by type.
Note: A single generic argument value will just be used once,
rather than matched multiple times (as of Spring 1.1).
Parameters: value - the argument value Parameters: type - the type of the constructor argument |
addGenericArgumentValue | public void addGenericArgumentValue(ValueHolder newValue)(Code) | | Add generic argument value to be matched by type.
Note: A single generic argument value will just be used once,
rather than matched multiple times (as of Spring 1.1).
Parameters: newValue - the argument value in the form of a ValueHolder Note: Identical ValueHolder instances will only be registered once,to allow for merging and re-merging of argument value definitions. DistinctValueHolder instances carrying the same content are of course allowed. |
addIndexedArgumentValue | public void addIndexedArgumentValue(int index, Object value)(Code) | | Add argument value for the given index in the constructor argument list.
Parameters: index - the index in the constructor argument list Parameters: value - the argument value |
addIndexedArgumentValue | public void addIndexedArgumentValue(int index, Object value, String type)(Code) | | Add argument value for the given index in the constructor argument list.
Parameters: index - the index in the constructor argument list Parameters: value - the argument value Parameters: type - the type of the constructor argument |
addIndexedArgumentValue | public void addIndexedArgumentValue(int index, ValueHolder newValue)(Code) | | Add argument value for the given index in the constructor argument list.
Parameters: index - the index in the constructor argument list Parameters: newValue - the argument value in the form of a ValueHolder |
clear | public void clear()(Code) | | Clear this holder, removing all argument values.
|
getArgumentCount | public int getArgumentCount()(Code) | | Return the number of argument values held in this instance,
counting both indexed and generic argument values.
|
getArgumentValue | public ValueHolder getArgumentValue(int index, Class requiredType)(Code) | | Look for an argument value that either corresponds to the given index
in the constructor argument list or generically matches by type.
Parameters: index - the index in the constructor argument list Parameters: requiredType - the type to match the ValueHolder for the argument, or null if none set |
getArgumentValue | public ValueHolder getArgumentValue(int index, Class requiredType, Set usedValueHolders)(Code) | | Look for an argument value that either corresponds to the given index
in the constructor argument list or generically matches by type.
Parameters: index - the index in the constructor argument list Parameters: requiredType - the type to match (can be null to findan untyped argument value) Parameters: usedValueHolders - a Set of ValueHolder objects that have alreadybeen used in the current resolution process and should therefore notbe returned again (allowing to return the next generic argument matchin case of multiple generic argument values of the same type) the ValueHolder for the argument, or null if none set |
getGenericArgumentValue | public ValueHolder getGenericArgumentValue(Class requiredType)(Code) | | Look for a generic argument value that matches the given type.
Parameters: requiredType - the type to match (can be null to findan arbitrary next generic argument value) the ValueHolder for the argument, or null if none set |
getGenericArgumentValue | public ValueHolder getGenericArgumentValue(Class requiredType, Set usedValueHolders)(Code) | | Look for the next generic argument value that matches the given type,
ignoring argument values that have already been used in the current
resolution process.
Parameters: requiredType - the type to match (can be null to findan arbitrary next generic argument value) Parameters: usedValueHolders - a Set of ValueHolder objects that have already been usedin the current resolution process and should therefore not be returned again the ValueHolder for the argument, or null if none found |
getGenericArgumentValues | public List getGenericArgumentValues()(Code) | | Return the list of generic argument values.
unmodifiable List of ValueHolders See Also: ValueHolder |
getIndexedArgumentValue | public ValueHolder getIndexedArgumentValue(int index, Class requiredType)(Code) | | Get argument value for the given index in the constructor argument list.
Parameters: index - the index in the constructor argument list Parameters: requiredType - the type to match (can be null to matchuntyped values only) the ValueHolder for the argument, or null if none set |
getIndexedArgumentValues | public Map getIndexedArgumentValues()(Code) | | Return the map of indexed argument values.
unmodifiable Map with Integer index as key and ValueHolder as value See Also: ValueHolder |
hashCode | public int hashCode()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | Return if this holder does not contain any argument values,
neither indexed ones nor generic ones.
|
|
|