|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.config.TypedStringValue
public class TypedStringValue
Holder for a typed String value. Can be added to bean definitions in order to explicitly specify a target type for a String value, for example for collection elements.
This holder will just store the String value and the target type. The actual conversion will be performed by the bean factory.
BeanDefinition.getPropertyValues()
,
MutablePropertyValues.addPropertyValue(org.springframework.beans.PropertyValue)
Field Summary | |
---|---|
private boolean |
dynamic
|
private java.lang.Object |
source
|
private java.lang.String |
specifiedTypeName
|
private java.lang.Object |
targetType
|
private java.lang.String |
value
|
Constructor Summary | |
---|---|
TypedStringValue(java.lang.String value)
Create a new TypedStringValue for the given String value. |
|
TypedStringValue(java.lang.String value,
java.lang.Class targetType)
Create a new TypedStringValue for the given String value
and target type. |
|
TypedStringValue(java.lang.String value,
java.lang.String targetTypeName)
Create a new TypedStringValue for the given String value
and target type. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
|
java.lang.Object |
getSource()
Return the configuration source Object for this metadata element
(may be null ). |
java.lang.String |
getSpecifiedTypeName()
Return the type name as actually specified for this particular value, if any. |
java.lang.Class |
getTargetType()
Return the type to convert to. |
java.lang.String |
getTargetTypeName()
Return the type to convert to. |
java.lang.String |
getValue()
Return the String value. |
int |
hashCode()
|
boolean |
hasTargetType()
Return whether this typed String value carries a target type . |
boolean |
isDynamic()
Return whether this value has been marked as dynamic. |
java.lang.Class |
resolveTargetType(java.lang.ClassLoader classLoader)
Determine the type to convert to, resolving it from a specified class name if necessary. |
void |
setDynamic()
Mark this value as dynamic, i.e. |
void |
setSource(java.lang.Object source)
Set the configuration source Object for this metadata element. |
void |
setSpecifiedTypeName(java.lang.String specifiedTypeName)
Set the type name as actually specified for this particular value, if any. |
void |
setTargetType(java.lang.Class targetType)
Set the type to convert to. |
void |
setTargetTypeName(java.lang.String targetTypeName)
Specify the type to convert to. |
void |
setValue(java.lang.String value)
Set the String value. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String value
private volatile java.lang.Object targetType
private java.lang.Object source
private java.lang.String specifiedTypeName
private volatile boolean dynamic
Constructor Detail |
---|
public TypedStringValue(java.lang.String value)
TypedStringValue
for the given String value.
value
- the String valuepublic TypedStringValue(java.lang.String value, java.lang.Class targetType)
TypedStringValue
for the given String value
and target type.
value
- the String valuetargetType
- the type to convert topublic TypedStringValue(java.lang.String value, java.lang.String targetTypeName)
TypedStringValue
for the given String value
and target type.
value
- the String valuetargetTypeName
- the type to convert toMethod Detail |
---|
public void setValue(java.lang.String value)
Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.
PropertyPlaceholderConfigurer
public java.lang.String getValue()
public void setTargetType(java.lang.Class targetType)
Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.
PropertyPlaceholderConfigurer
public java.lang.Class getTargetType()
public void setTargetTypeName(java.lang.String targetTypeName)
public java.lang.String getTargetTypeName()
public boolean hasTargetType()
public java.lang.Class resolveTargetType(java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
classLoader
- the ClassLoader to use for resolving a (potential) class name
java.lang.ClassNotFoundException
- if the type cannot be resolvedpublic void setSource(java.lang.Object source)
Object
for this metadata element.
The exact type of the object will depend on the configuration mechanism used.
public java.lang.Object getSource()
BeanMetadataElement
Object
for this metadata element
(may be null
).
getSource
in interface BeanMetadataElement
public void setSpecifiedTypeName(java.lang.String specifiedTypeName)
public java.lang.String getSpecifiedTypeName()
public void setDynamic()
public boolean isDynamic()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |