public class ConversionContext extends Object
PropertyConverter
Modifier and Type | Class and Description |
---|---|
static class |
ConversionContext.Builder
Builder to create new instances of
ConversionContext . |
Modifier | Constructor and Description |
---|---|
protected |
ConversionContext(ConversionContext.Builder builder)
Private constructor used from builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addSupportedFormats(Class<? extends PropertyConverter> converterType,
String... formatDescriptors)
Allows to add information on the supported/tried formats, which can be shown to the user, especially when
conversion failed.
|
AnnotatedElement |
getAnnotatedElement()
Get the annotated element, if conversion is performed using injection mechanisms.
|
Configuration |
getConfiguration()
Get the configuration, which is targeted.
|
ConfigurationContext |
getConfigurationContext() |
String |
getKey()
Get the key accessed.
|
List<String> |
getSupportedFormats()
Get the supported/tried formats in precedence order.
|
TypeLiteral<?> |
getTargetType()
Get the target type required.
|
String |
toString() |
protected ConversionContext(ConversionContext.Builder builder)
builder
- the builder, not null.public String getKey()
public TypeLiteral<?> getTargetType()
public AnnotatedElement getAnnotatedElement()
public Configuration getConfiguration()
public void addSupportedFormats(Class<? extends PropertyConverter> converterType, String... formatDescriptors)
converterType
- the converter, which implements the formats provided.formatDescriptors
- the format descriptions in a human readable form, e.g. as regular expressions.public List<String> getSupportedFormats()
PropertyConverter
instances involved in a conversion.public ConfigurationContext getConfigurationContext()
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.