Package io.swagger.converter
Class ModelConverterContextImpl
- java.lang.Object
-
- io.swagger.converter.ModelConverterContextImpl
-
- All Implemented Interfaces:
ModelConverterContext
public class ModelConverterContextImpl extends Object implements ModelConverterContext
-
-
Constructor Summary
Constructors Constructor Description ModelConverterContextImpl(ModelConverter converter)ModelConverterContextImpl(List<ModelConverter> converters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineModel(String name, Model model)needs to be called whenever a Model is defined which can be referenced from another Model or PropertyvoiddefineModel(String name, Model model, Type type, String prevName)needs to be called whenever a Model is defined which can be referenced from another Model or PropertyIterator<ModelConverter>getConverters()Map<String,Model>getDefinedModels()com.fasterxml.jackson.annotation.JsonViewgetJsonView()Modelresolve(Type type)PropertyresolveProperty(Type type, Annotation[] annotations)voidsetJsonView(com.fasterxml.jackson.annotation.JsonView jsonView)
-
-
-
Constructor Detail
-
ModelConverterContextImpl
public ModelConverterContextImpl(List<ModelConverter> converters)
-
ModelConverterContextImpl
public ModelConverterContextImpl(ModelConverter converter)
-
-
Method Detail
-
getConverters
public Iterator<ModelConverter> getConverters()
- Specified by:
getConvertersin interfaceModelConverterContext- Returns:
- an Iterator of ModelConverters. This iterator is not reused
-
defineModel
public void defineModel(String name, Model model)
Description copied from interface:ModelConverterContextneeds to be called whenever a Model is defined which can be referenced from another Model or Property- Specified by:
defineModelin interfaceModelConverterContext- Parameters:
name- the name of the modelmodel- the Model
-
defineModel
public void defineModel(String name, Model model, Type type, String prevName)
Description copied from interface:ModelConverterContextneeds to be called whenever a Model is defined which can be referenced from another Model or Property- Specified by:
defineModelin interfaceModelConverterContext- Parameters:
name- the name of the modelmodel- the Modeltype- the TypeprevName- the (optional) previous name
-
resolveProperty
public Property resolveProperty(Type type, Annotation[] annotations)
- Specified by:
resolvePropertyin interfaceModelConverterContext- Parameters:
type- the property Class- Returns:
- a property representation of the Class. Any referenced models will be defined already.
-
resolve
public Model resolve(Type type)
- Specified by:
resolvein interfaceModelConverterContext- Parameters:
type- The Model Class- Returns:
- a Model representation of the Class. Any referenced models will be defined already.
-
getJsonView
public com.fasterxml.jackson.annotation.JsonView getJsonView()
- Specified by:
getJsonViewin interfaceModelConverterContext- Returns:
- A nullable JsonView annotation.
-
setJsonView
public void setJsonView(com.fasterxml.jackson.annotation.JsonView jsonView)
- Specified by:
setJsonViewin interfaceModelConverterContext- Parameters:
jsonView- A nullable JsonView annotation, which is normally added to the annotated method to filter the response.
-
-