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
-
-
Constructor Summary
Constructors Constructor Description CustomScalarRegistryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomScalargetCustomScalar(java.lang.String graphQLTypeName)static CustomScalarRegistrygetCustomScalarRegistry(java.lang.String schema)Retrieves theCustomScalarRegistryfor the given schema.graphql.schema.GraphQLScalarTypegetGraphQLCustomScalarType(java.lang.String graphQLTypeName)voidregisterGraphQLScalarType(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)static voidsetCustomScalarRegistry(java.lang.String schema, CustomScalarRegistry customScalarRegistry)Sets theCustomScalarRegistryfor the given schema.
-
-
-
Method Detail
-
registerGraphQLScalarType
public void registerGraphQLScalarType(graphql.schema.GraphQLScalarType type, java.lang.Class<?> valueClazz)- Specified by:
registerGraphQLScalarTypein interfaceCustomScalarRegistry
-
getGraphQLCustomScalarType
public graphql.schema.GraphQLScalarType getGraphQLCustomScalarType(java.lang.String graphQLTypeName)
- Specified by:
getGraphQLCustomScalarTypein interfaceCustomScalarRegistry
-
getCustomScalar
public CustomScalar getCustomScalar(java.lang.String graphQLTypeName)
- Specified by:
getCustomScalarin interfaceCustomScalarRegistry
-
getCustomScalarRegistry
public static CustomScalarRegistry getCustomScalarRegistry(java.lang.String schema)
Retrieves theCustomScalarRegistryfor the given schema. This registry is initialized in the generated classCustomScalarRegistryInitializer.
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:
java.lang.IllegalArgumentException- If noCustomScalarRegistryhas been defined for the given schema
-
setCustomScalarRegistry
public static void setCustomScalarRegistry(java.lang.String schema, CustomScalarRegistry customScalarRegistry)Sets theCustomScalarRegistryfor the given schema. This method should only be called from the generated classCustomScalarRegistryInitializer.
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
-
-