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 CustomScalarRegistrycustomScalarRegistryAs 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 CustomScalargetCustomScalar(java.lang.String graphQLTypeName)Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.graphql.schema.GraphQLScalarTypegetGraphQLCustomScalarType(java.lang.String graphQLTypeName)Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.voidregisterGraphQLScalarType(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)Manually register oneGraphQLScalarType.
-
Field Details
-
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
-
CustomScalarRegistryImpl
public CustomScalarRegistryImpl()
-
-
Method Details
-
registerGraphQLScalarType
public void registerGraphQLScalarType(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)Description copied from interface:CustomScalarRegistryManually register oneGraphQLScalarType.- Specified by:
registerGraphQLScalarTypein interfaceCustomScalarRegistryvalueClazz- 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:CustomScalarRegistryRetrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Specified by:
getGraphQLCustomScalarTypein interfaceCustomScalarRegistry- Returns:
- the
GraphQLScalarType, or null if no converter has been registered for the given name
-
getCustomScalar
Description copied from interface:CustomScalarRegistryRetrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Specified by:
getCustomScalarin interfaceCustomScalarRegistry- Returns:
- the
GraphQLScalarType, or null if no converter has been registered for the given name
-