public static final class ConversionContext.Builder extends Object
ConversionContext.| Constructor | Description |
|---|---|
Builder(String key,
TypeLiteral<?> targetType) |
Creates a new Builder instance.
|
Builder(Configuration configuration,
String key,
TypeLiteral<?> targetType) |
Creates a new Builder instance.
|
Builder(TypeLiteral<?> targetType) |
Creates a new Builder instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
ConversionContext.Builder |
addSupportedFormats(Class<?> converterType,
String... formatDescriptors) |
Add the formats provided by a
PropertyConverter. |
ConversionContext |
build() |
Builds a new context instance.
|
ConversionContext.Builder |
setAnnotatedElement(AnnotatedElement annotatedElement) |
Sets the annotated element, when configuration is injected.
|
ConversionContext.Builder |
setConfiguration(Configuration configuration) |
Sets the configuration.
|
ConversionContext.Builder |
setKey(String key) |
Sets the key.
|
ConversionContext.Builder |
setTargetType(TypeLiteral targetType) |
Sets the target type explicitly.
|
ConversionContext.Builder |
setValues(List<PropertyValue> values) |
Sets the underlying values evaluated.
|
ConversionContext.Builder |
setValues(PropertyValue... values) |
Sets the underlying values evaluated.
|
String |
toString() |
public Builder(TypeLiteral<?> targetType)
targetType - the target typepublic Builder(String key, TypeLiteral<?> targetType)
key - the requested key, may be null.targetType - the target typepublic Builder(Configuration configuration, String key, TypeLiteral<?> targetType)
configuration - the configuration, not null.key - the requested key, may be null.targetType - the target typepublic ConversionContext.Builder setKey(String key)
key - the key, not null.public ConversionContext.Builder setValues(List<PropertyValue> values)
values - the values, not null.public ConversionContext.Builder setValues(PropertyValue... values)
values - the values, not null.public ConversionContext.Builder setConfiguration(Configuration configuration)
configuration - the configuration, not nullpublic ConversionContext.Builder setAnnotatedElement(AnnotatedElement annotatedElement)
annotatedElement - the annotated element, not nullpublic ConversionContext.Builder setTargetType(TypeLiteral targetType)
Provider
instances, where the provider's result type must be produced.targetType - thepublic ConversionContext.Builder addSupportedFormats(Class<?> converterType, String... formatDescriptors)
PropertyConverter. This method should be called by each converters
performing/trying conversion, so the user can be given feedback on the supported formats on failure.converterType - the converters type, not null.formatDescriptors - the formats supported in a human readable form, e.g. as regular expressions.public ConversionContext build()
Copyright © 2014–2019 Apache Software Foundation. All rights reserved.