public class ConversionContext extends Object
PropertyConverter| Modifier and Type | Class | Description |
|---|---|---|
static class |
ConversionContext.Builder |
Builder to create new instances of
ConversionContext. |
| Modifier and Type | Field | Description |
|---|---|---|
static ConversionContext |
EMPTY |
| Modifier | Constructor | Description |
|---|---|---|
protected |
ConversionContext(ConversionContext.Builder builder) |
Private constructor used from builder.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addSupportedFormats(Class<?> converterType,
String... formatDescriptors) |
Allows to addPropertyValue 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() |
Deprecated.
|
String |
getKey() |
Get the key accessed.
|
Map<String,String> |
getMeta() |
Evaluate the metadata for the current target key from the given values.
|
List<String> |
getSupportedFormats() |
Get the supported/tried formats in precedence order.
|
TypeLiteral<?> |
getTargetType() |
Get the target type required.
|
List<PropertyValue> |
getValues() |
Get the correspnoding underlying property values matching the given key, in order of significance
(most significant last).
|
ConversionContext.Builder |
toBuilder() |
Creates a builder based on this instance.
|
String |
toString() |
public static final ConversionContext EMPTY
protected ConversionContext(ConversionContext.Builder builder)
builder - the builder, not null.public String getKey()
public List<PropertyValue> getValues()
public TypeLiteral<?> getTargetType()
public AnnotatedElement getAnnotatedElement()
null.public Configuration getConfiguration()
null.public Map<String,String> getMeta()
public void addSupportedFormats(Class<?> converterType, String... formatDescriptors)
converterType - the converters, 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.null.public ConversionContext.Builder toBuilder()
@Deprecated public ConfigurationContext getConfigurationContext()
getConfiguration() and Configuration.getContext().Copyright © 2014–2019 Apache Software Foundation. All rights reserved.