Package org.picocontainer.converters
Class BuiltInConverters
- java.lang.Object
-
- org.picocontainer.converters.BuiltInConverters
-
- All Implemented Interfaces:
java.io.Serializable
,Converters
public class BuiltInConverters extends java.lang.Object implements Converters, java.io.Serializable
Provides some built-in converters used byDefaultPicoContainer
. It supports by default primitive types (and boxed equivalents) and forFile
andURL
types. Built-in converters can be changed by extending the class and overriding the methodaddBuiltInConverters()
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BuiltInConverters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBuiltInConverters()
protected void
addConverter(Converter<?> converter, java.lang.Class<?> key)
boolean
canConvert(java.lang.reflect.Type type)
Returns true if a converters is available to convert to the given object typejava.lang.Object
convert(java.lang.String paramValue, java.lang.reflect.Type type)
Converts a particular string value into the target type
-
-
-
Method Detail
-
addBuiltInConverters
protected void addBuiltInConverters()
-
addConverter
protected void addConverter(Converter<?> converter, java.lang.Class<?> key)
-
canConvert
public boolean canConvert(java.lang.reflect.Type type)
Description copied from interface:Converters
Returns true if a converters is available to convert to the given object type- Specified by:
canConvert
in interfaceConverters
- Parameters:
type
- the object Type to convert to- Returns:
- true if the type can be converted to
-
convert
public java.lang.Object convert(java.lang.String paramValue, java.lang.reflect.Type type)
Description copied from interface:Converters
Converts a particular string value into the target type- Specified by:
convert
in interfaceConverters
- Parameters:
paramValue
- the String value to converttype
- the object Type to convert to- Returns:
- The converted Object instance
-
-