Class OASFactoryResolver
- java.lang.Object
-
- org.eclipse.microprofile.openapi.spi.OASFactoryResolver
-
public abstract class OASFactoryResolver extends java.lang.Object
This class is not intended to be used by end-users. It should be used by vendors to set their implementation of OASFactoryResolver.
Service provider for OASFactoryResolver. The implementation registers itself via theServiceLoader
mechanism or by manually setting their implementation using the setInstance method.
-
-
Constructor Summary
Constructors Constructor Description OASFactoryResolver()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T extends Constructible>
TcreateObject(java.lang.Class<T> clazz)
Create a new instance of a constructible element from the OpenAPI model tree.static OASFactoryResolver
instance()
Creates an OASFactoryResolver object.static void
setInstance(OASFactoryResolver factory)
Set the instance.
-
-
-
Method Detail
-
createObject
public abstract <T extends Constructible> T createObject(java.lang.Class<T> clazz)
Create a new instance of a constructible element from the OpenAPI model tree.- Type Parameters:
T
- describes the type parameter- Parameters:
clazz
- represents a model which extends the org.eclipse.microprofile.openapi.models.Constructible interface- Returns:
- a new instance of the requested model class
- Throws:
java.lang.NullPointerException
- if the specified class is nulljava.lang.IllegalArgumentException
- if an instance could not be created, most likely, due to an illegal or inappropriate class
-
instance
public static OASFactoryResolver instance()
Creates an OASFactoryResolver object. Only used internally from withinOASFactory
- Returns:
- an instance of OASFactoryResolver
-
setInstance
public static void setInstance(OASFactoryResolver factory)
Set the instance. It is used by OSGi environment while service loader pattern is not supported.- Parameters:
factory
- set the instance.
-
-