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
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 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 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
Manually register one GraphQL directive.- Specified by:
registerDirectivein interfaceDirectiveRegistry
-
getDirective
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
-