Top Description Fields Constructors Methods
org.eclipse.microprofile.openapi.spi

public abstract Class OASFactoryResolver

extends Object
Class Inheritance
Imports
java.security.AccessController, .PrivilegedAction, java.util.ServiceLoader, org.eclipse.microprofile.openapi.models.Constructible

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 java.util.ServiceLoader mechanism or by manually setting their implementation using the setInstance method.

Field Summary

Modifier and TypeField and Description
private static volatile OASFactoryResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract <
describes the type parameter
T extends Constructible
>
T

Returns:

a new instance of the requested model class
createObject
(Class<T>
represents a model which extends the org.eclipse.microprofile.openapi.models.Constructible interface
clazz
)

Create a new instance of a constructible element from the OpenAPI model tree.

public static OASFactoryResolver

Returns:

an instance of OASFactoryResolver
instance
()

Creates an OASFactoryResolver object.

private static OASFactoryResolver
public static void
setInstance(OASFactoryResolver
set the instance.
factory
)

Set the instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static volatile OASFactoryResolver instance

Constructor Detail

OASFactoryResolverback to summary
public OASFactoryResolver()

Method Detail

createObjectback to summary
public abstract <T extends Constructible> T createObject(Class<T> clazz)

Create a new instance of a constructible element from the OpenAPI model tree.

Parameters
<T>
describes the type parameter
clazz:Class<T>

represents a model which extends the org.eclipse.microprofile.openapi.models.Constructible interface

Returns:T

a new instance of the requested model class

Exceptions
NullPointerException:
if the specified class is null
IllegalArgumentException:
if an instance could not be created, most likely, due to an illegal or inappropriate class
instanceback to summary
public static OASFactoryResolver instance()

Creates an OASFactoryResolver object. Only used internally from within org.eclipse.microprofile.openapi.OASFactory

Returns:OASFactoryResolver

an instance of OASFactoryResolver

loadSpiback to summary
private static OASFactoryResolver loadSpi(ClassLoader cl)
setInstanceback to summary
public static void setInstance(OASFactoryResolver factory)

Set the instance. It is used by OSGi environment while service loader pattern is not supported.

Parameters
factory:OASFactoryResolver

set the instance.