public class

TypedStringValue

extends Object
implements BeanMetadataElement
java.lang.Object
   ↳ org.springframework.beans.factory.config.TypedStringValue

Class Overview

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.

Summary

Public Constructors
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.
Public Methods
boolean equals(Object other)
Object getSource()
Return the configuration source Object for this metadata element (may be null).
String getSpecifiedTypeName()
Return the type name as actually specified for this particular value, if any.
Class getTargetType()
Return the type to convert to.
String getTargetTypeName()
Return the type to convert to.
String getValue()
Return the String value.
boolean hasTargetType()
Return whether this typed String value carries a target type .
int hashCode()
boolean isDynamic()
Return whether this value has been marked as dynamic.
Class resolveTargetType(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(Object source)
Set the configuration source Object for this metadata element.
void setSpecifiedTypeName(String specifiedTypeName)
Set the type name as actually specified for this particular value, if any.
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()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.BeanMetadataElement

Public Constructors

public TypedStringValue (String value)

Also: SpringBeans

Create a new TypedStringValue for the given String value.

Parameters
value the String value

public TypedStringValue (String value, Class targetType)

Also: SpringBeans

Create a new TypedStringValue for the given String value and target type.

Parameters
value the String value
targetType the type to convert to

public TypedStringValue (String value, String targetTypeName)

Also: SpringBeans

Create a new TypedStringValue for the given String value and target type.

Parameters
value the String value
targetTypeName the type to convert to

Public Methods

public boolean equals (Object other)

public Object getSource ()

Also: SpringBeans

Return the configuration source Object for this metadata element (may be null).

public String getSpecifiedTypeName ()

Also: SpringBeans

Return the type name as actually specified for this particular value, if any.

public Class getTargetType ()

Also: SpringBeans

Return the type to convert to.

public String getTargetTypeName ()

Also: SpringBeans

Return the type to convert to.

public String getValue ()

Also: SpringBeans

Return the String value.

public boolean hasTargetType ()

Also: SpringBeans

Return whether this typed String value carries a target type .

public int hashCode ()

public boolean isDynamic ()

Also: SpringBeans

Return whether this value has been marked as dynamic.

public Class resolveTargetType (ClassLoader classLoader)

Also: SpringBeans

Determine the type to convert to, resolving it from a specified class name if necessary. Will also reload a specified Class from its name when called with the target type already resolved.

Parameters
classLoader the ClassLoader to use for resolving a (potential) class name
Returns
  • the resolved type to convert to
Throws
ClassNotFoundException if the type cannot be resolved

public void setDynamic ()

Also: SpringBeans

Mark this value as dynamic, i.e. as containing an expression and hence not being subject to caching.

public void setSource (Object source)

Also: SpringBeans

Set the configuration source Object for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

public void setSpecifiedTypeName (String specifiedTypeName)

Also: SpringBeans

Set the type name as actually specified for this particular value, if any.

public void setTargetType (Class targetType)

Also: SpringBeans

Set the type to convert to.

Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

public void setTargetTypeName (String targetTypeName)

Also: SpringBeans

Specify the type to convert to.

public void setValue (String value)

Also: SpringBeans

Set the String value.

Only necessary for manipulating a registered value, for example in BeanFactoryPostProcessors.

public String toString ()