Class DirectiveRegistryImpl
java.lang.Object
com.graphql_java_generator.client.directive.DirectiveRegistryImpl
- All Implemented Interfaces:
DirectiveRegistry
- Author:
- etienne-sf
-
Field Summary
Modifier and TypeFieldDescriptionstatic DirectiveRegistry
As we may have or not have Spring at runtime, we manually manage a singleton. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDirective
(String name) Retrieves the registeredGraphQLScalarType
for this GraphQL CustomScalar.void
This method registers allGraphQLScalarType
that are declared as SpringComponent
.void
registerDirective
(Directive type) Manually register one GraphQL directive.
-
Field Details
-
directiveRegistry
As we may have or not have Spring at runtime, we manually manage a singleton. This field is private, and should only be accessed through#getDirectiveRegistry()
.
-
-
Constructor Details
-
DirectiveRegistryImpl
public DirectiveRegistryImpl()
-
-
Method Details
-
registerAllDirectives
public void registerAllDirectives()This method registers allGraphQLScalarType
that are declared as SpringComponent
. Another way to registerGraphQLScalarType
is to call the#registerGraphQLScalarType(GraphQLScalarType)
.
This implementation works only if this class has been loaded as a Spring Component.- Specified by:
registerAllDirectives
in interfaceDirectiveRegistry
-
registerDirective
Manually register one GraphQL directive.- Specified by:
registerDirective
in interfaceDirectiveRegistry
-
getDirective
Retrieves the registeredGraphQLScalarType
for this GraphQL CustomScalar.- Specified by:
getDirective
in interfaceDirectiveRegistry
- Returns:
- the
Directive
, or null if no directive has been registered for the given name
-