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 DirectiveRegistrydirectiveRegistryAs we may have or not have Spring at runtime, we manually manage a singleton.
-
Constructor Summary
Constructors Constructor Description DirectiveRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectivegetDirective(java.lang.String name)Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.voidregisterAllDirectives()This method registers allGraphQLScalarTypethat are declared as SpringComponent.voidregisterDirective(Directive type)Manually register one GraphQL directive.
-
-
-
Field Detail
-
directiveRegistry
public static DirectiveRegistry 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().
-
-
Method Detail
-
registerAllDirectives
public void registerAllDirectives()
This method registers allGraphQLScalarTypethat are declared as SpringComponent. Another way to registerGraphQLScalarTypeis to call the#registerGraphQLScalarType(GraphQLScalarType).
This implementation works only if this class has been loaded as a Spring Component.- Specified by:
registerAllDirectivesin interfaceDirectiveRegistry
-
registerDirective
public void registerDirective(Directive type)
Manually register one GraphQL directive.- Specified by:
registerDirectivein interfaceDirectiveRegistry
-
getDirective
public Directive getDirective(java.lang.String name)
Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Specified by:
getDirectivein interfaceDirectiveRegistry- Returns:
- the
Directive, or null if no directive has been registered for the given name
-
-