Supports values for a specific index in the constructor argument list as well as for generic argument matches by type.
BeanDefinition#getConstructorArgumentValues
| Modifier and Type | Class and Description |
|---|---|
| public static class | ConstructorArgumentValues.
Holder for a constructor argument value, with an optional type attribute indicating the target type of the actual constructor argument. |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ConstructorArgumentValues(ConstructorArgumentValues
the ConstructorArgumentValues to copy original)Deep copy constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addArgumentValues(ConstructorArgumentValues other)
Copy all given argument values into this object, using separate holder instances to keep the values independent of the original object. |
| public void | addGenericArgumentValue(Object
the argument value value)Add a generic argument value to be matched by type. |
| public void | addGenericArgumentValue(Object
the argument value value, String the type of the constructor argument type)Add a generic argument value to be matched by type. |
| public void | addGenericArgumentValue(ConstructorArgumentValues.
the argument value in the form of a ValueHolder newValueNote 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. Add a generic argument value to be matched by type or name (if available). |
| public void | addIndexedArgumentValue(int
the index in the constructor argument list index, Object the argument value value)Add an argument value for the given index in the constructor argument list. |
| public void | addIndexedArgumentValue(int
the index in the constructor argument list index, Object the argument value value, String the type of the constructor argument type)Add an argument value for the given index in the constructor argument list. |
| public void | addIndexedArgumentValue(int
the index in the constructor argument list index, ConstructorArgumentValues.the argument value in the form of a ValueHolder newValueAdd an argument value for the given index in the constructor argument list. |
| private void | addOrMergeGenericArgumentValue(ConstructorArgumentValues.
the argument value in the form of a ValueHolder newValueAdd a generic argument value, merging the new value (typically a collection)
with the current value if demanded: see |
| private void | addOrMergeIndexedArgumentValue(Integer
the index in the constructor argument list key, ConstructorArgumentValues.the argument value in the form of a ValueHolder newValueAdd an argument value for the given index in the constructor argument list,
merging the new value (typically a collection) with the current value
if demanded: see |
| public void | |
| public boolean | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | getArgumentCount()
Return the number of argument values held in this instance, counting both indexed and generic argument values. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe index in the constructor argument list index, Class<?> the parameter type to match requiredType)Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe index in the constructor argument list index, Class<?> the parameter type to match requiredType, String the parameter name to match requiredName)Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe index in the constructor argument list index, Class<?> the parameter type to match (can be requiredType, String null
to find an untyped argument value)the parameter name to match (can be requiredName, Set<ConstructorArgumentValues.null
to find an unnamed argument value, or empty String to match any name)a Set of ValueHolder objects that have already
been used in the current resolution process and should therefore not
be returned again (allowing to return the next generic argument match
in case of multiple generic argument values of the same type) usedValueHoldersLook for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe type to match requiredType)Look for a generic argument value that matches the given type. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe type to match requiredType, String the name to match requiredName)Look for a generic argument value that matches the given type. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none foundthe type to match (can be requiredType, String null to find
an arbitrary next generic argument value)the name to match (can be requiredName, Set<ConstructorArgumentValues.null to not
match argument values by name, or empty String to match any name)a Set of ValueHolder objects that have already been used
in the current resolution process and should therefore not be returned again usedValueHoldersLook 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 | Returns: unmodifiable List of ValueHoldersReturn the list of generic argument values. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe index in the constructor argument list index, Class<?> the type to match (can be requiredType)null to match
untyped values only)Get argument value for the given index in the constructor argument list. |
| public ConstructorArgumentValues. | Returns: the ValueHolder for the argument, ornull if none setthe index in the constructor argument list index, Class<?> the type to match (can be requiredType, String null to match
untyped values only)the type to match (can be requiredName)null to match
unnamed values only, or empty String to match any name)Get argument value for the given index in the constructor argument list. |
| public Map | Returns: unmodifiable Map with Integer index as key and ValueHolder as valueReturn the map of indexed argument values. |
| public int | |
| public boolean | hasIndexedArgumentValue(int
the index in the constructor argument list index)Check whether an argument value has been registered for the given index. |
| public boolean | isEmpty()
Return if this holder does not contain any argument values, neither indexed ones nor generic ones. |
| genericArgumentValues | back to summary |
|---|---|
| private final List<ConstructorArgumentValues. | |
| indexedArgumentValues | back to summary |
|---|---|
| private final Map<Integer, ConstructorArgumentValues. | |
| ConstructorArgumentValues | back to summary |
|---|---|
| public ConstructorArgumentValues() Create a new empty ConstructorArgumentValues object. | |
| ConstructorArgumentValues | back to summary |
|---|---|
| public ConstructorArgumentValues(ConstructorArgumentValues original) Deep copy constructor.
| |
| addArgumentValues | back to summary |
|---|---|
| public void addArgumentValues(ConstructorArgumentValues other) Copy all given argument values into this object, using separate holder instances to keep the values independent of 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 | back to summary |
|---|---|
| public void addGenericArgumentValue(Object value) Add a generic argument value to be matched by type. Note A single generic argument value will just be used once, rather than matched multiple times.
| |
| addGenericArgumentValue | back to summary |
|---|---|
| public void addGenericArgumentValue(Object value, String type) Add a generic argument value to be matched by type. Note A single generic argument value will just be used once, rather than matched multiple times. | |
| addGenericArgumentValue | back to summary |
|---|---|
| public void addGenericArgumentValue(ConstructorArgumentValues. Add a generic argument value to be matched by type or name (if available). Note A single generic argument value will just be used once, rather than matched multiple times.
| |
| addIndexedArgumentValue | back to summary |
|---|---|
| public void addIndexedArgumentValue(int index, Object value) Add an argument value for the given index in the constructor argument list.
| |
| addIndexedArgumentValue | back to summary |
|---|---|
| public void addIndexedArgumentValue(int index, Object value, String type) Add an argument value for the given index in the constructor argument list. | |
| addIndexedArgumentValue | back to summary |
|---|---|
| public void addIndexedArgumentValue(int index, ConstructorArgumentValues. Add an argument value for the given index in the constructor argument list.
| |
| addOrMergeGenericArgumentValue | back to summary |
|---|---|
| private void addOrMergeGenericArgumentValue(ConstructorArgumentValues. Add a generic argument value, merging the new value (typically a collection)
with the current value if demanded: see
| |
| addOrMergeIndexedArgumentValue | back to summary |
|---|---|
| private void addOrMergeIndexedArgumentValue(Integer key, ConstructorArgumentValues. Add an argument value for the given index in the constructor argument list,
merging the new value (typically a collection) with the current value
if demanded: see
| |
| clear | back to summary |
|---|---|
| public void clear() Clear this holder, removing all argument values. | |
| containsNamedArgument | back to summary |
|---|---|
| public boolean containsNamedArgument() Determine whether at least one argument value refers to a name.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getArgumentCount | back to summary |
|---|---|
| public int getArgumentCount() Return the number of argument values held in this instance, counting both indexed and generic argument values. | |
| getArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
| |
| getArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
| |
| getArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Look for an argument value that either corresponds to the given index in the constructor argument list or generically matches by type.
| |
| getGenericArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Look for a generic argument value that matches the given type.
| |
| getGenericArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Look for a generic argument value that matches the given type.
| |
| getGenericArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. 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.
| |
| getGenericArgumentValues | back to summary |
|---|---|
| public List Return the list of generic argument values.
| |
| getIndexedArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Get argument value for the given index in the constructor argument list.
| |
| getIndexedArgumentValue | back to summary |
|---|---|
| public ConstructorArgumentValues. Get argument value for the given index in the constructor argument list.
| |
| getIndexedArgumentValues | back to summary |
|---|---|
| public Map Return the map of indexed argument values.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasIndexedArgumentValue | back to summary |
|---|---|
| public boolean hasIndexedArgumentValue(int index) Check whether an argument value has been registered for the given index.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Return if this holder does not contain any argument values, neither indexed ones nor generic ones. | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Object | |
| private String | |
| private Object | |
| private String | |
| private Object |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ValueHolder(Object
the argument value value, String the type of the constructor argument type)Create a new ValueHolder for the given value and type. |
| public | ValueHolder(Object
the argument value value, String the type of the constructor argument type, String the name of the constructor argument name)Create a new ValueHolder for the given value, type and name. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | contentEquals(ConstructorArgumentValues.
Determine whether the content of this ValueHolder is equal to the content of the given other ValueHolder. |
| private int | |
| public ConstructorArgumentValues. | copy()
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents. |
| public synchronized Object | getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion. |
| public String | |
| public Object | getSource()
Overrides default org. Return the configuration source |
| public String | |
| public Object | |
| public synchronized boolean | isConverted()
Return whether this holder contains a converted value already ( |
| public synchronized void | setConvertedValue(Object value)
Set the converted value of the constructor argument, after processed type conversion. |
| public void | |
| public void | |
| public void | |
| public void |
| converted | back to summary |
|---|---|
| private boolean converted | |
| convertedValue | back to summary |
|---|---|
| private Object convertedValue
| |
| name | back to summary |
|---|---|
| private String name
| |
| source | back to summary |
|---|---|
| private Object source
| |
| type | back to summary |
|---|---|
| private String type
| |
| value | back to summary |
|---|---|
| private Object value
| |
| ValueHolder | back to summary |
|---|---|
| public ValueHolder(Object value) Create a new ValueHolder for the given value.
| |
| ValueHolder | back to summary |
|---|---|
| public ValueHolder(Object value, String type) Create a new ValueHolder for the given value and type. | |
| ValueHolder | back to summary |
|---|---|
| public ValueHolder(Object value, String type, String name) Create a new ValueHolder for the given value, type and name. | |
| contentEquals | back to summary |
|---|---|
| private boolean contentEquals(ConstructorArgumentValues. Determine whether the content of this ValueHolder is equal to the content of the given other ValueHolder. Note that ValueHolder does not implement | |
| contentHashCode | back to summary |
|---|---|
| private int contentHashCode() Determine whether the hash code of the content of this ValueHolder. Note that ValueHolder does not implement | |
| copy | back to summary |
|---|---|
| public ConstructorArgumentValues. Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents. | |
| getConvertedValue | back to summary |
|---|---|
| public synchronized Object getConvertedValue() Return the converted value of the constructor argument, after processed type conversion.
| |
| getName | back to summary |
|---|---|
| public String getName() Return the name of the constructor argument.
| |
| getSource | back to summary |
|---|---|
| public Object getSource() Overrides default org. Doc from org. Return the configuration source | |
| getType | back to summary |
|---|---|
| public String getType() Return the type of the constructor argument.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() Return the value for the constructor argument.
| |
| isConverted | back to summary |
|---|---|
| public synchronized boolean isConverted() Return whether this holder contains a converted value already ( | |
| setConvertedValue | back to summary |
|---|---|
| public synchronized void setConvertedValue(Object value) Set the converted value of the constructor argument, after processed type conversion. | |
| setName | back to summary |
|---|---|
| public void setName(String name) Set the name of the constructor argument. | |
| setSource | back to summary |
|---|---|
| public void setSource(Object source) Set the configuration source The exact type of the object will depend on the configuration mechanism used. | |
| setType | back to summary |
|---|---|
| public void setType(String type) Set the type of the constructor argument. | |
| setValue | back to summary |
|---|---|
| public void setValue(Object value) Set the value for the constructor argument. | |