public class JacksonModule extends Object implements com.github.victools.jsonschema.generator.Module
jackson-annotations:
JsonPropertyDescription and JsonClassDescription annotations.JsonProperty annotations.| Constructor and Description |
|---|
JacksonModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyToConfigBuilder(com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder builder) |
protected <A extends Annotation> |
getAnnotationFromFieldOrGetter(com.github.victools.jsonschema.generator.FieldScope field,
Class<A> annotationClass)
Retrieves the annotation instance of the given type, either from the field it self or (if not present) from its getter.
|
protected com.fasterxml.jackson.databind.BeanDescription |
getBeanDescriptionForClass(com.fasterxml.classmate.ResolvedType targetType)
Create a jackson
BeanDescription for the given type's erased class in order to avoid having to re-create the complexity therein. |
protected String |
getPropertyNameOverride(com.github.victools.jsonschema.generator.FieldScope field)
Look-up an alternative name as per the following order of priority.
|
protected String |
resolveDescription(com.github.victools.jsonschema.generator.FieldScope field)
Determine the given type's associated "description" in the following order of priority.
|
protected boolean |
shouldIgnoreField(com.github.victools.jsonschema.generator.FieldScope field)
Determine whether a given field should be ignored, according to various jackson annotations for that purpose,
e.g. |
public void applyToConfigBuilder(com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder builder)
applyToConfigBuilder in interface com.github.victools.jsonschema.generator.Moduleprotected <A extends Annotation> A getAnnotationFromFieldOrGetter(com.github.victools.jsonschema.generator.FieldScope field, Class<A> annotationClass)
A - type of annotationfield - field to retrieve annotation instance from (or from its getter)annotationClass - type of annotationnull)MemberScope.getAnnotation(Class),
FieldScope.findGetter()protected String resolveDescription(com.github.victools.jsonschema.generator.FieldScope field)
JsonPropertyDescription annotation on the field itselfJsonPropertyDescription annotation on the field's getter methodJsonClassDescription annotation on the field's typefield - field for which to collect an available descriptionnull)protected String getPropertyNameOverride(com.github.victools.jsonschema.generator.FieldScope field)
JsonProperty annotation on the field itselfJsonProperty annotation on the field's getter methodfield - field to look-up alternative property name fornull)protected final com.fasterxml.jackson.databind.BeanDescription getBeanDescriptionForClass(com.fasterxml.classmate.ResolvedType targetType)
BeanDescription for the given type's erased class in order to avoid having to re-create the complexity therein.
targetType - type for whose erased class the BeanDescription should be createdprotected boolean shouldIgnoreField(com.github.victools.jsonschema.generator.FieldScope field)
JsonIgnore, JsonIgnoreType, JsonIgnorePropertiesfield - field to checkCopyright © 2019 VicTools. All rights reserved.