Module org.eclipse.microprofile.openapi
Package org.eclipse.microprofile.openapi.spi

## Class OASFactoryResolver

- java.lang.Object
- - org.eclipse.microprofile.openapi.spi.OASFactoryResolver

    public abstract class OASFactoryResolver
    extends 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 the `ServiceLoader` mechanism or by manually setting their implementation using the setInstance method.

### Constructor Summary

Constructors
`OASFactoryResolver()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`abstract <T extends Constructible> T` `createObject​(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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OASFactoryResolver

    public OASFactoryResolver()

### Method Detail

#### createObject

    public abstract <T extends Constructible> T createObject​(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:
  `NullPointerException` - if the specified class is null
  `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 within `OASFactory`

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.