Class DirectiveRegistryImpl

java.lang.Object
com.graphql_java_generator.client.directive.DirectiveRegistryImpl
All Implemented Interfaces:
DirectiveRegistry

@Component public class DirectiveRegistryImpl extends Object implements DirectiveRegistry
Author:
etienne-sf
  • Field Details

    • 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().
  • Constructor Details

    • DirectiveRegistryImpl

      public DirectiveRegistryImpl()
  • Method Details

    • registerAllDirectives

      public void registerAllDirectives()
      This method registers all GraphQLScalarType that are declared as Spring Component. Another way to register GraphQLScalarType is to call the #registerGraphQLScalarType(GraphQLScalarType).
      This implementation works only if this class has been loaded as a Spring Component.
      Specified by:
      registerAllDirectives in interface DirectiveRegistry
    • registerDirective

      public void registerDirective(Directive type)
      Manually register one GraphQL directive.
      Specified by:
      registerDirective in interface DirectiveRegistry
    • getDirective

      public Directive getDirective(String name)
      Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
      Specified by:
      getDirective in interface DirectiveRegistry
      Returns:
      the Directive, or null if no directive has been registered for the given name