Package io.swagger.jackson
Class AbstractModelConverter
- java.lang.Object
-
- io.swagger.jackson.AbstractModelConverter
-
- All Implemented Interfaces:
ModelConverter
- Direct Known Subclasses:
ModelResolver
public abstract class AbstractModelConverter extends Object implements ModelConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.AnnotationIntrospector_intrprotected com.fasterxml.jackson.databind.ObjectMapper_mapperprotected Map<com.fasterxml.jackson.databind.JavaType,String>_resolvedTypeNamesMinor optimization: no need to keep on resolving same types over and over again.protected TypeNameResolver_typeNameResolver
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractModelConverter(com.fasterxml.jackson.databind.ObjectMapper mapper)protectedAbstractModelConverter(com.fasterxml.jackson.databind.ObjectMapper mapper, TypeNameResolver typeNameResolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_description(com.fasterxml.jackson.databind.introspect.Annotated ann)protected String_findDefaultValue(com.fasterxml.jackson.databind.introspect.Annotated a)protected String_findExampleValue(com.fasterxml.jackson.databind.introspect.Annotated a)protected Boolean_findReadOnly(com.fasterxml.jackson.databind.introspect.Annotated a)protected Boolean_findReadOnlyFromAccessMode(com.fasterxml.jackson.databind.introspect.Annotated a)protected String_findTypeName(com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.BeanDescription beanDesc)protected boolean_isSetType(Class<?> cls)protected String_subTypeName(com.fasterxml.jackson.databind.jsontype.NamedType type)protected String_typeName(com.fasterxml.jackson.databind.JavaType type)protected String_typeName(com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.BeanDescription beanDesc)protected String_typeQName(com.fasterxml.jackson.databind.JavaType type)protected static Comparator<Property>getPropertyComparator()protected booleanprioritizeAnnotationInspectorSchemaName()whether to resolve schema name by first using AnnotationInspector registered implementations defaults to false, override returning `true` to obtain pre-1.5.24 behaviourModelresolve(Type type, ModelConverterContext context, Iterator<ModelConverter> chain)PropertyresolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain)
-
-
-
Field Detail
-
_mapper
protected final com.fasterxml.jackson.databind.ObjectMapper _mapper
-
_intr
protected final com.fasterxml.jackson.databind.AnnotationIntrospector _intr
-
_typeNameResolver
protected final TypeNameResolver _typeNameResolver
-
-
Constructor Detail
-
AbstractModelConverter
protected AbstractModelConverter(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
AbstractModelConverter
protected AbstractModelConverter(com.fasterxml.jackson.databind.ObjectMapper mapper, TypeNameResolver typeNameResolver)
-
-
Method Detail
-
getPropertyComparator
protected static Comparator<Property> getPropertyComparator()
-
resolveProperty
public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain)
- Specified by:
resolvePropertyin interfaceModelConverterannotations- to consider when resolving the propertychain- the chain of model converters to try if this implementation cannot process- Returns:
- null if this ModelConverter cannot convert the given Type
-
_description
protected String _description(com.fasterxml.jackson.databind.introspect.Annotated ann)
-
_typeName
protected String _typeName(com.fasterxml.jackson.databind.JavaType type)
-
_typeName
protected String _typeName(com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.BeanDescription beanDesc)
-
prioritizeAnnotationInspectorSchemaName
protected boolean prioritizeAnnotationInspectorSchemaName()
whether to resolve schema name by first using AnnotationInspector registered implementations defaults to false, override returning `true` to obtain pre-1.5.24 behaviour- Returns:
- false
- Since:
- 1.5.24
-
_findTypeName
protected String _findTypeName(com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.BeanDescription beanDesc)
-
_typeQName
protected String _typeQName(com.fasterxml.jackson.databind.JavaType type)
-
_subTypeName
protected String _subTypeName(com.fasterxml.jackson.databind.jsontype.NamedType type)
-
_findDefaultValue
protected String _findDefaultValue(com.fasterxml.jackson.databind.introspect.Annotated a)
-
_findExampleValue
protected String _findExampleValue(com.fasterxml.jackson.databind.introspect.Annotated a)
-
_findReadOnly
protected Boolean _findReadOnly(com.fasterxml.jackson.databind.introspect.Annotated a)
-
_findReadOnlyFromAccessMode
protected Boolean _findReadOnlyFromAccessMode(com.fasterxml.jackson.databind.introspect.Annotated a)
-
_isSetType
protected boolean _isSetType(Class<?> cls)
-
resolve
public Model resolve(Type type, ModelConverterContext context, Iterator<ModelConverter> chain)
- Specified by:
resolvein interfaceModelConverterchain- the chain of model converters to try if this implementation cannot process- Returns:
- null if this ModelConverter cannot convert the given Type
-
-