Package io.swagger.v3.core.converter
Class ModelConverterContextImpl
- java.lang.Object
-
- io.swagger.v3.core.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, Schema model)needs to be called whenever a Model is defined which can be referenced from another Model or PropertyvoiddefineModel(String name, Schema model, AnnotatedType type, String prevName)needs to be called whenever a Schema is defined which can be referenced from another Model or PropertyvoiddefineModel(String name, Schema model, Type type, String prevName)needs to be called whenever a Schema is defined which can be referenced from another Model or PropertyIterator<ModelConverter>getConverters()Map<String,Schema>getDefinedModels()Schemaresolve(AnnotatedType type)
-
-
-
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, Schema 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, Schema model, Type type, String prevName)
Description copied from interface:ModelConverterContextneeds to be called whenever a Schema 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
-
defineModel
public void defineModel(String name, Schema model, AnnotatedType type, String prevName)
Description copied from interface:ModelConverterContextneeds to be called whenever a Schema 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 AnnotatedTypeprevName- the (optional) previous name
-
getDefinedModels
public Map<String,Schema> getDefinedModels()
- Specified by:
getDefinedModelsin interfaceModelConverterContext
-
resolve
public Schema resolve(AnnotatedType type)
- Specified by:
resolvein interfaceModelConverterContext- Parameters:
type- The Schema- Returns:
- a Model representation of the Class. Any referenced models will be defined already.
-
-