Class DefaultTypeFunction
- java.lang.Object
-
- graphql.annotations.processor.typeFunctions.DefaultTypeFunction
-
- All Implemented Interfaces:
TypeFunction
public class DefaultTypeFunction extends java.lang.Object implements TypeFunction
-
-
Constructor Summary
Constructors Constructor Description DefaultTypeFunction()DefaultTypeFunction(GraphQLInputProcessor graphQLInputProcessor, GraphQLOutputProcessor graphQLOutputProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()graphql.schema.GraphQLTypebuildType(boolean input, java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType, ProcessingElementsContainer container)Build aGraphQLTypeobject from a java type.booleancanBuildType(java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType)Get whether this builder handles the given type.java.lang.StringgetTypeName(java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType)Get the graphql type name that will be used to build the type.java.lang.Class<DefaultTypeFunction>register(TypeFunction function)voidsetGraphQLInputProcessor(GraphQLInputProcessor graphQLInputProcessor)voidsetGraphQLOutputProcessor(GraphQLOutputProcessor graphQLOutputProcessor)voidunsetGraphQLInputProcessor(GraphQLInputProcessor graphQLInputProcessor)voidunsetGraphQLOutputProcessor(GraphQLOutputProcessor graphQLOutputProcessor)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface graphql.annotations.processor.typeFunctions.TypeFunction
buildType
-
-
-
-
Constructor Detail
-
DefaultTypeFunction
public DefaultTypeFunction()
-
DefaultTypeFunction
public DefaultTypeFunction(GraphQLInputProcessor graphQLInputProcessor, GraphQLOutputProcessor graphQLOutputProcessor)
-
-
Method Detail
-
canBuildType
public boolean canBuildType(java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType)Description copied from interface:TypeFunctionGet whether this builder handles the given type.- Specified by:
canBuildTypein interfaceTypeFunction- Parameters:
aClass- The java type to build the type name forannotatedType- TheAnnotatedTypeof the java type, which may be a {link AnnotatedParameterizedType}- Returns:
- True if this builder can build the type
-
activate
public void activate()
-
register
public java.lang.Class<DefaultTypeFunction> register(TypeFunction function)
-
getTypeName
public java.lang.String getTypeName(java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType)Description copied from interface:TypeFunctionGet the graphql type name that will be used to build the type. The type name is passed to theTypeFunction.buildType(java.lang.Class<?>, java.lang.reflect.AnnotatedType, graphql.annotations.processor.ProcessingElementsContainer)method when building the type.- Specified by:
getTypeNamein interfaceTypeFunction- Parameters:
aClass- The java type to build the type name forannotatedType- TheAnnotatedTypeof the java type, which may be a {link AnnotatedParameterizedType}- Returns:
- The graphql type name
-
buildType
public graphql.schema.GraphQLType buildType(boolean input, java.lang.Class<?> aClass, java.lang.reflect.AnnotatedType annotatedType, ProcessingElementsContainer container)Description copied from interface:TypeFunctionBuild aGraphQLTypeobject from a java type.- Specified by:
buildTypein interfaceTypeFunction- Parameters:
input- is InputTypeaClass- The java type to build the type name forannotatedType- TheAnnotatedTypeof the java type, which may be a {link AnnotatedParameterizedType}container- a class that hold several members that are required in order to build schema- Returns:
- The built
GraphQLType
-
setGraphQLInputProcessor
public void setGraphQLInputProcessor(GraphQLInputProcessor graphQLInputProcessor)
-
unsetGraphQLInputProcessor
public void unsetGraphQLInputProcessor(GraphQLInputProcessor graphQLInputProcessor)
-
setGraphQLOutputProcessor
public void setGraphQLOutputProcessor(GraphQLOutputProcessor graphQLOutputProcessor)
-
unsetGraphQLOutputProcessor
public void unsetGraphQLOutputProcessor(GraphQLOutputProcessor graphQLOutputProcessor)
-
-