public class ConfigurationMetadata
extends com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper.Base
Given the following simple configuration:
public class ExampleConfiguration extends Configuration {
@NotNull
private String name;
private List<String> names = Collections.emptyList();
@JsonProperty
public String getName() {
return name;
}
@JsonProperty
public List<String> getNames() {
return names;
}
}
This leads to the following entries:
name -> {SimpleType} "[simple type, class java.lang.String]" names -> {CollectionType} "[collection type; class java.util.List, contains [simple type, class java.lang.String]]"| Constructor and Description |
|---|
ConfigurationMetadata(com.fasterxml.jackson.databind.ObjectMapper mapper,
Class<?> klass)
Create a metadata instance and
|
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor |
expectObjectFormat(com.fasterxml.jackson.databind.JavaType type) |
boolean |
isCollectionOfStrings(String fieldName)
Check if a field is a collection of strings.
|
public ConfigurationMetadata(com.fasterxml.jackson.databind.ObjectMapper mapper,
Class<?> klass)
mapper - the ObjectMapper that is used to parse the configuration fileklass - the target class of the configurationpublic boolean isCollectionOfStrings(String fieldName)
fieldName - the field namepublic com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor expectObjectFormat(com.fasterxml.jackson.databind.JavaType type)
throws com.fasterxml.jackson.databind.JsonMappingException
expectObjectFormat in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapperexpectObjectFormat in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper.Basecom.fasterxml.jackson.databind.JsonMappingExceptionCopyright © 2020. All rights reserved.