Class OASFactoryResolver
java.lang.Object
org.eclipse.microprofile.openapi.spi.OASFactoryResolver
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 the
Service provider for OASFactoryResolver. The implementation registers itself via the
ServiceLoader
mechanism or by manually
setting their implementation using the setInstance method.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract <T extends Constructible>
TcreateObject
(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.
-
Constructor Details
-
OASFactoryResolver
public OASFactoryResolver()
-
-
Method Details
-
createObject
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:
NullPointerException
- if the specified class is nullIllegalArgumentException
- if an instance could not be created, most likely, due to an illegal or inappropriate class
-
instance
Creates an OASFactoryResolver object. Only used internally from withinOASFactory
- Returns:
- an instance of OASFactoryResolver
-
setInstance
Set the instance. It is used by OSGi environment while service loader pattern is not supported.- Parameters:
factory
- set the instance.
-