Class CustomScalarRegistryImpl

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

@Component
public class CustomScalarRegistryImpl
extends java.lang.Object
implements CustomScalarRegistry
Author:
etienne-sf
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static CustomScalarRegistry customScalarRegistry
    As we may have or not have Spring at runtime, we manually manage a singleton.
  • Constructor Summary

    Constructors 
    Constructor Description
    CustomScalarRegistryImpl()  
  • Method Summary

    Modifier and Type Method Description
    CustomScalar getCustomScalar​(java.lang.String graphQLTypeName)
    Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
    graphql.schema.GraphQLScalarType getGraphQLCustomScalarType​(java.lang.String graphQLTypeName)
    Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
    void registerGraphQLScalarType​(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)
    Manually register one GraphQLScalarType.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • customScalarRegistry

      public static CustomScalarRegistry customScalarRegistry
      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 #getCustomScalarRegistry().
  • Constructor Details

  • Method Details

    • registerGraphQLScalarType

      public void registerGraphQLScalarType​(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)
      Description copied from interface: CustomScalarRegistry
      Manually register one GraphQLScalarType.
      Specified by:
      registerGraphQLScalarType in interface CustomScalarRegistry
      valueClazz - The java The java type that will contain values for this custom scalar. This is needed to properly create the data from the value read in a string, especially when reading a GraphQL request, when in client mode
    • getGraphQLCustomScalarType

      public graphql.schema.GraphQLScalarType getGraphQLCustomScalarType​(java.lang.String graphQLTypeName)
      Description copied from interface: CustomScalarRegistry
      Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
      Specified by:
      getGraphQLCustomScalarType in interface CustomScalarRegistry
      Returns:
      the GraphQLScalarType, or null if no converter has been registered for the given name
    • getCustomScalar

      public CustomScalar getCustomScalar​(java.lang.String graphQLTypeName)
      Description copied from interface: CustomScalarRegistry
      Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
      Specified by:
      getCustomScalar in interface CustomScalarRegistry
      Returns:
      the GraphQLScalarType, or null if no converter has been registered for the given name