public interface PropertyConverter
A property converter is configured for the Pinject extension
by placing a provider configuration file in the resource directory
META-INF/services
of a directory or JAR file on the classpath
of the extension. The name of the configuration file is:
org.soulwing.cdi.properties.spi.PropertyConverter
The file may contain one or more fully-qualified class names of classes that implement this interface.
Modifier and Type | Interface and Description |
---|---|
static interface |
PropertyConverter.Context
A context for a property conversion.
|
Modifier and Type | Method and Description |
---|---|
Object |
convert(String value,
PropertyConverter.Context context)
Converts the given string representation of a property value to an
instance of the underlying type supported by this converter.
|
String |
getName()
Gets the name for this property converter.
|
boolean |
supports(Class<?> type)
Tests whether this converter supports a given type.
|
String getName()
The Property
qualifier allows a named converter to be specified.
null
)boolean supports(Class<?> type)
type
- the subject typetrue
if this converter can converter string representations
of a property of the given type
Object convert(String value, PropertyConverter.Context context) throws IllegalArgumentException
value
- the value to convertcontext
- conversion contextvalue
as type T
IllegalArgumentException
- if the given value is a syntactically
invalid string representation for type
Copyright © 2014–2016. All rights reserved.