Class ConstructorArgumentValues.ValueHolder
java.lang.Object
org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
- All Implemented Interfaces:
BeanMetadataElement
- Enclosing class:
- ConstructorArgumentValues
public static class ConstructorArgumentValues.ValueHolder
extends Object
implements BeanMetadataElement
Holder for a constructor argument value, with an optional type
attribute indicating the target type of the actual constructor argument.
-
Constructor Summary
ConstructorDescriptionValueHolder
(Object value) Create a new ValueHolder for the given value.ValueHolder
(Object value, String type) Create a new ValueHolder for the given value and type.ValueHolder
(Object value, String type, String name) Create a new ValueHolder for the given value, type and name. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.Return the converted value of the constructor argument, after processed type conversion.getName()
Return the name of the constructor argument.Return the configuration sourceObject
for this metadata element (may benull
).getType()
Return the type of the constructor argument.getValue()
Return the value for the constructor argument.boolean
Return whether this holder contains a converted value already (true
), or whether the value still needs to be converted (false
).void
setConvertedValue
(Object value) Set the converted value of the constructor argument, after processed type conversion.void
Set the name of the constructor argument.void
Set the configuration sourceObject
for this metadata element.void
Set the type of the constructor argument.void
Set the value for the constructor argument.
-
Constructor Details
-
ValueHolder
Create a new ValueHolder for the given value.- Parameters:
value
- the argument value
-
ValueHolder
Create a new ValueHolder for the given value and type.- Parameters:
value
- the argument valuetype
- the type of the constructor argument
-
ValueHolder
Create a new ValueHolder for the given value, type and name.- Parameters:
value
- the argument valuetype
- the type of the constructor argumentname
- the name of the constructor argument
-
-
Method Details
-
setValue
Set the value for the constructor argument. -
getValue
Return the value for the constructor argument. -
setType
Set the type of the constructor argument. -
getType
Return the type of the constructor argument. -
setName
Set the name of the constructor argument. -
getName
Return the name of the constructor argument. -
setSource
Set the configuration sourceObject
for this metadata element.The exact type of the object will depend on the configuration mechanism used.
-
getSource
Description copied from interface:BeanMetadataElement
Return the configuration sourceObject
for this metadata element (may benull
).- Specified by:
getSource
in interfaceBeanMetadataElement
-
isConverted
public boolean isConverted()Return whether this holder contains a converted value already (true
), or whether the value still needs to be converted (false
). -
setConvertedValue
Set the converted value of the constructor argument, after processed type conversion. -
getConvertedValue
Return the converted value of the constructor argument, after processed type conversion. -
copy
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.
-