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 Details

    • OASFactoryResolver

      public OASFactoryResolver()
  • Method Details

    • 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.