public static final class ConversionContext.Builder extends Object
ConversionContext
.Constructor and Description |
---|
ConversionContext.Builder(Configuration configuration,
ConfigurationContext configurationContext,
String key,
TypeLiteral<?> targetType)
Creates a new Builder instance.
|
ConversionContext.Builder(String key,
TypeLiteral<?> targetType)
Creates a new Builder instance.
|
ConversionContext.Builder(TypeLiteral<?> targetType)
Creates a new Builder instance.
|
Modifier and Type | Method and Description |
---|---|
ConversionContext.Builder |
addSupportedFormats(Class<? extends PropertyConverter> 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 |
setConfigurationContext(ConfigurationContext configurationContext)
Sets the configuration.
|
ConversionContext.Builder |
setKey(String key)
Sets the key.
|
String |
toString() |
public ConversionContext.Builder(TypeLiteral<?> targetType)
targetType
- the target typepublic ConversionContext.Builder(String key, TypeLiteral<?> targetType)
key
- the requested key, may be null.targetType
- the target typepublic ConversionContext.Builder(Configuration configuration, ConfigurationContext configurationContext, String key, TypeLiteral<?> targetType)
configuration
- the configuration, not null.configurationContext
- configuration context, 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 setConfiguration(Configuration configuration)
configuration
- the configuration, not nullpublic ConversionContext.Builder setConfigurationContext(ConfigurationContext configurationContext)
configurationContext
- the configuration, not nullpublic ConversionContext.Builder setAnnotatedElement(AnnotatedElement annotatedElement)
annotatedElement
- the annotated element, not nullpublic ConversionContext.Builder addSupportedFormats(Class<? extends PropertyConverter> converterType, String... formatDescriptors)
PropertyConverter
. This method should be called by each converter
performing/trying conversion, so the user can be given feedback on the supported formats on failure.converterType
- the converter type, not null.formatDescriptors
- the formats supported in a human readable form, e.g. as regular expressions.public ConversionContext build()
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.