public class SchemaRegistry extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.eclipse.microprofile.openapi.models.media.Schema |
checkRegistration(org.jboss.jandex.Type type,
TypeResolver resolver,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Check if the entityType is eligible for registration using the
typeResolver.
|
static SchemaRegistry |
currentInstance()
Retrieve the
SchemaRegistry previously created by
newInstance for the current thread, or null if none has yet
been created. |
boolean |
hasRef(org.jboss.jandex.Type instanceType) |
boolean |
hasSchema(org.jboss.jandex.Type instanceType) |
static boolean |
hasSchema(org.jboss.jandex.Type type,
TypeResolver resolver)
Convenience method to check if the current thread's
SchemaRegistry
contains a schema for the given type (which may require type resolution using resolver). |
boolean |
isTypeRegistrationSupported(org.jboss.jandex.Type type,
org.eclipse.microprofile.openapi.models.media.Schema schema) |
org.eclipse.microprofile.openapi.models.media.Schema |
lookupRef(org.jboss.jandex.Type instanceType) |
org.eclipse.microprofile.openapi.models.media.Schema |
lookupSchema(org.jboss.jandex.Type instanceType) |
static SchemaRegistry |
newInstance(AnnotationScannerContext context)
Create a new instance of a
SchemaRegistry on this thread. |
org.eclipse.microprofile.openapi.models.media.Schema |
register(org.jboss.jandex.Type entityType,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Register the provided
Schema for the provided Type. |
static org.eclipse.microprofile.openapi.models.media.Schema |
registerReference(org.jboss.jandex.Type type,
TypeResolver resolver,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Attempt to register ONLY a reference to entityType using the typeResolver.
|
static void |
remove() |
public static SchemaRegistry newInstance(AnnotationScannerContext context)
SchemaRegistry on this thread. The
registry returned by this method may also be obtained by subsequent calls
to currentInstance(). Additional calls of this method will
replace the registry in the current thread context with a new instance.context - current scanner contextpublic static SchemaRegistry currentInstance()
SchemaRegistry previously created by
newInstance for the current thread, or null if none has yet
been created.SchemaRegistry instance or nullpublic static void remove()
public static org.eclipse.microprofile.openapi.models.media.Schema checkRegistration(org.jboss.jandex.Type type,
TypeResolver resolver,
org.eclipse.microprofile.openapi.models.media.Schema schema)
CLASS
PARAMETERIZED_TYPE
TYPE_VARIABLE
WILDCARD_TYPE
mp.openapi.extensions.smallrye.schema-references.enable, and the
resolved type is available in the registry's IndexView then the
schema can be registered.
Only if the type has not already been registered earlier will it be
added.type - the Type the Schema applies toresolver - a TypeResolver that will be used to resolve
parameterized and wildcard typesschema - Schema to add to the registrypublic static org.eclipse.microprofile.openapi.models.media.Schema registerReference(org.jboss.jandex.Type type,
TypeResolver resolver,
org.eclipse.microprofile.openapi.models.media.Schema schema)
CLASS
PARAMETERIZED_TYPE
TYPE_VARIABLE
WILDCARD_TYPE
mp.openapi.extensions.smallrye.schema-references.enable, and the
resolved type is available in the registry's IndexView then the
schema reference can be registered.
Only if the type has not already been registered earlier will it be
added.type - the Type the Schema applies toresolver - a TypeResolver that will be used to resolve
parameterized and wildcard typesschema - Schema to add to the registrypublic static boolean hasSchema(org.jboss.jandex.Type type,
TypeResolver resolver)
SchemaRegistry
contains a schema for the given type (which may require type resolution using resolver).type - type to check for existence of schemaresolver - resolver for type parameterpublic org.eclipse.microprofile.openapi.models.media.Schema register(org.jboss.jandex.Type entityType,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Schema for the provided Type. If an
existing schema has already been registered for the type, it will be
replaced by the schema given in this method.entityType - the type the Schema applies toschema - Schema to add to the registrySchemapublic org.eclipse.microprofile.openapi.models.media.Schema lookupRef(org.jboss.jandex.Type instanceType)
public boolean hasRef(org.jboss.jandex.Type instanceType)
public org.eclipse.microprofile.openapi.models.media.Schema lookupSchema(org.jboss.jandex.Type instanceType)
public boolean hasSchema(org.jboss.jandex.Type instanceType)
public boolean isTypeRegistrationSupported(org.jboss.jandex.Type type,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Copyright © 2018–2021. All rights reserved.