Package com.graphql_java_generator
Class CustomScalarRegistryImpl
java.lang.Object
com.graphql_java_generator.CustomScalarRegistryImpl
- All Implemented Interfaces:
CustomScalarRegistry
@Component public class CustomScalarRegistryImpl extends java.lang.Object implements CustomScalarRegistry
- Author:
- EtienneSF
-
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 graphql.schema.GraphQLScalarTypegetGraphQLScalarType(java.lang.String graphQLTypeName)Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.voidregisterAllGraphQLScalarType()This method registers allGraphQLScalarTypethat are declared as SpringComponent.voidregisterGraphQLScalarType(graphql.schema.GraphQLScalarType type)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
-
registerAllGraphQLScalarType
public void registerAllGraphQLScalarType()This method registers allGraphQLScalarTypethat are declared as SpringComponent. Another way to registerGraphQLScalarTypeis to call theCustomScalarRegistry.registerGraphQLScalarType(GraphQLScalarType).
This implementation works only if this class has been loaded as a Spring Component.- Specified by:
registerAllGraphQLScalarTypein interfaceCustomScalarRegistry
-
registerGraphQLScalarType
public void registerGraphQLScalarType(graphql.schema.GraphQLScalarType type)Manually register oneGraphQLScalarType.- Specified by:
registerGraphQLScalarTypein interfaceCustomScalarRegistry
-
getGraphQLScalarType
public graphql.schema.GraphQLScalarType getGraphQLScalarType(java.lang.String graphQLTypeName)Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Specified by:
getGraphQLScalarTypein interfaceCustomScalarRegistry- Returns:
- the
GraphQLScalarType, or null if no converter has been registered for the given name
-