Class DirectiveRegistryImpl
java.lang.Object
com.graphql_java_generator.client.directive.DirectiveRegistryImpl
- All Implemented Interfaces:
DirectiveRegistry
@Component public class DirectiveRegistryImpl extends java.lang.Object implements DirectiveRegistry
- Author:
- etienne-sf
-
Field Summary
Fields Modifier and Type Field Description static DirectiveRegistry
directiveRegistry
As we may have or not have Spring at runtime, we manually manage a singleton. -
Constructor Summary
Constructors Constructor Description DirectiveRegistryImpl()
-
Method Summary
Modifier and Type Method Description Directive
getDirective(java.lang.String name)
Retrieves the registeredGraphQLScalarType
for this GraphQL CustomScalar.void
registerAllDirectives()
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
-