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
Constructors Constructor Description ValueHolder(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstructorArgumentValues.ValueHoldercopy()Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.ObjectgetConvertedValue()Return the converted value of the constructor argument, after processed type conversion.StringgetName()Return the name of the constructor argument.ObjectgetSource()Return the configuration sourceObjectfor this metadata element (may benull).StringgetType()Return the type of the constructor argument.ObjectgetValue()Return the value for the constructor argument.booleanisConverted()Return whether this holder contains a converted value already (true), or whether the value still needs to be converted (false).voidsetConvertedValue(Object value)Set the converted value of the constructor argument, after processed type conversion.voidsetName(String name)Set the name of the constructor argument.voidsetSource(Object source)Set the configuration sourceObjectfor this metadata element.voidsetType(String type)Set the type of the constructor argument.voidsetValue(Object value)Set the value for the constructor argument.
Constructor Detail
ValueHolder
public ValueHolder(Object value)
Create a new ValueHolder for the given value.- Parameters:
value- the argument value
ValueHolder
public ValueHolder(Object value, String type)
Create a new ValueHolder for the given value and type.- Parameters:
value- the argument valuetype- the type of the constructor argument
ValueHolder
public ValueHolder(Object value, String type, String name)
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 Detail
setValue
public void setValue(Object value)
Set the value for the constructor argument.- See Also:
PropertyPlaceholderConfigurer
setSource
public void setSource(Object source)
Set the configuration sourceObjectfor this metadata element.The exact type of the object will depend on the configuration mechanism used.
getSource
public Object getSource()
Description copied from interface:BeanMetadataElementReturn the configuration sourceObjectfor this metadata element (may benull).- Specified by:
getSourcein 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
public void setConvertedValue(Object value)
Set the converted value of the constructor argument, after processed type conversion.
getConvertedValue
public Object getConvertedValue()
Return the converted value of the constructor argument, after processed type conversion.
copy
public ConstructorArgumentValues.ValueHolder copy()
Create a copy of this ValueHolder: that is, an independent ValueHolder instance with the same contents.