|
||||||||||
| 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)| Constructor Summary | |
|---|---|
TypedStringValue(String value)
Create a new TypedStringValue for the given String value. |
|
TypedStringValue(String value,
Class targetType)
Create a new TypedStringValue for the given String value
and target type. |
|
TypedStringValue(String value,
String targetTypeName)
Create a new TypedStringValue for the given String value
and target type. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object other)
|
Object |
getSource()
Return the configuration source Object for this metadata element
(may be null). |
Class |
getTargetType()
Return the type to convert to. |
String |
getTargetTypeName()
Return the type to convert to. |
String |
getValue()
Return the String value. |
int |
hashCode()
|
boolean |
hasTargetType()
Return whether this typed String value carries a target type . |
Class |
resolveTargetType(ClassLoader classLoader)
Determine the type to convert to, resolving it from a specified class name if necessary. |
void |
setSource(Object source)
Set the configuration source Object for this metadata element. |
void |
setTargetType(Class targetType)
Set the type to convert to. |
void |
setTargetTypeName(String targetTypeName)
Specify the type to convert to. |
void |
setValue(String value)
Set the String value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TypedStringValue(String value)
TypedStringValue for the given String value.
value - the String value
public TypedStringValue(String value,
Class targetType)
TypedStringValue for the given String value
and target type.
value - the String valuetargetType - the type to convert to
public TypedStringValue(String value,
String targetTypeName)
TypedStringValue for the given String value
and target type.
value - the String valuetargetTypeName - the type to convert to| Method Detail |
|---|
public void setValue(String value)
Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.
PropertyPlaceholderConfigurerpublic String getValue()
public void setTargetType(Class targetType)
Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.
PropertyPlaceholderConfigurerpublic Class getTargetType()
public void setTargetTypeName(String targetTypeName)
public String getTargetTypeName()
public boolean hasTargetType()
public Class resolveTargetType(ClassLoader classLoader)
throws ClassNotFoundException
classLoader - the ClassLoader to use for resolving a (potential) class name
ClassNotFoundException - if the type cannot be resolvedpublic void setSource(Object source)
Object for this metadata element.
The exact type of the object will depend on the configuration mechanism used.
public Object getSource()
BeanMetadataElementObject for this metadata element
(may be null).
getSource in interface BeanMetadataElementpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||