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 void
defineModel(String name, Model model)
needs to be called whenever a Model is defined which can be referenced from another Model or Propertyvoid
defineModel(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.JsonView
getJsonView()
Model
resolve(Type type)
Property
resolveProperty(Type type, Annotation[] annotations)
void
setJsonView(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:
getConverters
in interfaceModelConverterContext
- Returns:
- an Iterator of ModelConverters. This iterator is not reused
-
defineModel
public void defineModel(String name, Model model)
Description copied from interface:ModelConverterContext
needs to be called whenever a Model is defined which can be referenced from another Model or Property- Specified by:
defineModel
in 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:ModelConverterContext
needs to be called whenever a Model is defined which can be referenced from another Model or Property- Specified by:
defineModel
in 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:
resolveProperty
in 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:
resolve
in 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:
getJsonView
in interfaceModelConverterContext
- Returns:
- A nullable JsonView annotation.
-
setJsonView
public void setJsonView(com.fasterxml.jackson.annotation.JsonView jsonView)
- Specified by:
setJsonView
in interfaceModelConverterContext
- Parameters:
jsonView
- A nullable JsonView annotation, which is normally added to the annotated method to filter the response.
-
-