Class CustomScalarRegistryImpl

java.lang.Object
com.graphql_java_generator.customscalars.CustomScalarRegistryImpl
All Implemented Interfaces:
CustomScalarRegistry

@Component public class CustomScalarRegistryImpl extends Object implements CustomScalarRegistry
Author:
etienne-sf
  • Constructor Details

    • CustomScalarRegistryImpl

      public CustomScalarRegistryImpl()
  • Method Details

    • registerGraphQLScalarType

      public void registerGraphQLScalarType(graphql.schema.GraphQLScalarType type, Class<?> valueClazz)
      Specified by:
      registerGraphQLScalarType in interface CustomScalarRegistry
    • getGraphQLCustomScalarType

      public graphql.schema.GraphQLScalarType getGraphQLCustomScalarType(String graphQLTypeName)
      Specified by:
      getGraphQLCustomScalarType in interface CustomScalarRegistry
    • getCustomScalar

      public CustomScalar getCustomScalar(String graphQLTypeName)
      Specified by:
      getCustomScalar in interface CustomScalarRegistry
    • getCustomScalarRegistry

      public static CustomScalarRegistry getCustomScalarRegistry(String schema)
      Retrieves the CustomScalarRegistry for the given schema. This registry is initialized in the generated class CustomScalarRegistryInitializer.
      Note: this method is an internal utility method.
      Parameters:
      schema - value of the springBeanSuffix plugin parameter for the searched schema. When there is only one schema, this plugin parameter is usually not set. In this case, its default value ("") is used.
      Returns:
      Throws:
      IllegalArgumentException - If no CustomScalarRegistry has been defined for the given schema
    • setCustomScalarRegistry

      public static void setCustomScalarRegistry(String schema, CustomScalarRegistry customScalarRegistry)
      Sets the CustomScalarRegistry for the given schema. This method should only be called from the generated class CustomScalarRegistryInitializer.
      Note: this method is an internal utility method.
      Parameters:
      schema - value of the springBeanSuffix plugin parameter for the searched schema. When there is only one schema, this plugin parameter is usually not set. In this case, its default value ("") is used.
      customScalarRegistry - The CustomScalarRegistry associated with this schema