Class CustomScalarRegistryImpl
java.lang.Object
com.graphql_java_generator.client.CustomScalarRegistryImpl
- All Implemented Interfaces:
CustomScalarRegistry
- Author:
- etienne-sf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCustomScalar(String graphQLTypeName) Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.static CustomScalargetCustomScalar(String schema, String graphQLTypeName) Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.graphql.schema.GraphQLScalarTypegetGraphQLCustomScalarType(String graphQLTypeName) Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.static graphql.schema.GraphQLScalarTypegetGraphQLCustomScalarType(String schema, String graphQLTypeName) Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.static voidregisterCustomScalarRegistry(String schema, Consumer<CustomScalarRegistry> customScalarRegistryInitializer) Sets theCustomScalarRegistryfor the given schema.voidregisterGraphQLScalarType(String typeName, graphql.schema.GraphQLScalarType type, Class<?> valueClazz) Manually register oneGraphQLScalarType.
-
Constructor Details
-
CustomScalarRegistryImpl
public CustomScalarRegistryImpl()
-
-
Method Details
-
registerCustomScalarRegistry
public static void registerCustomScalarRegistry(String schema, Consumer<CustomScalarRegistry> customScalarRegistryInitializer) Sets theCustomScalarRegistryfor the given schema. This method should only be called from the generated classRegistriesInitializer.
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- TheCustomScalarRegistryassociated with this schema
-
getGraphQLCustomScalarType
public static graphql.schema.GraphQLScalarType getGraphQLCustomScalarType(String schema, String graphQLTypeName) Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Parameters:
graphQLTypeName-- Returns:
- the
GraphQLScalarType, or null if no converter has been registered for the given name
-
getCustomScalar
Retrieves the registeredGraphQLScalarTypefor this GraphQL CustomScalar.- Parameters:
graphQLTypeName-- Returns:
- the
GraphQLScalarType, or null if no converter has been registered for the given name
-
registerGraphQLScalarType
public void registerGraphQLScalarType(String typeName, graphql.schema.GraphQLScalarType type, Class<?> valueClazz) Description copied from interface:CustomScalarRegistryManually register oneGraphQLScalarType.- Specified by:
registerGraphQLScalarTypein interfaceCustomScalarRegistry- Parameters:
typeName- The name of the custom scalar type, as defined in the provided GaphQL schema. It may be different from the providedgraphQLScalarTypetype- The GraphQL custom scalar class, that contain the coercing rules to serialize and unserialize this custom scalarvalueClazz- 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
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
-