public class GraphQLAnnotations extends java.lang.Object implements GraphQLAnnotationsProcessor
| Modifier and Type | Class and Description |
|---|---|
static class |
GraphQLAnnotations.GraphQLFieldDefinitionWrapper |
| Modifier and Type | Field and Description |
|---|---|
protected TypeFunction |
defaultTypeFunction |
static GraphQLAnnotations |
instance |
| Constructor and Description |
|---|
GraphQLAnnotations() |
GraphQLAnnotations(TypeFunction defaultTypeFunction) |
| Modifier and Type | Method and Description |
|---|---|
protected graphql.schema.GraphQLFieldDefinition |
field(java.lang.reflect.Field field) |
protected static graphql.schema.GraphQLFieldDefinition |
field(java.lang.reflect.Method method) |
protected java.util.Map<java.lang.String,java.lang.reflect.Field> |
getAllFields(java.lang.Class c) |
protected graphql.schema.GraphQLArgument |
getArgument(java.lang.reflect.Parameter parameter,
graphql.schema.GraphQLType t) |
protected graphql.schema.GraphQLFieldDefinition |
getField(java.lang.reflect.Field field) |
protected graphql.schema.GraphQLFieldDefinition |
getField(java.lang.reflect.Method method) |
graphql.schema.GraphQLInterfaceType.Builder |
getIfaceBuilder(java.lang.Class<?> iface)
This will examine the class and return a
GraphQLInterfaceType.Builder ready for further definition |
graphql.schema.GraphQLInputObjectType |
getInputObject(graphql.schema.GraphQLObjectType graphQLType,
java.lang.String newNamePrefix)
This will turn a
GraphQLObjectType into a corresponding GraphQLInputObjectType |
static GraphQLAnnotations |
getInstance() |
graphql.schema.GraphQLType |
getInterface(java.lang.Class<?> iface)
This will examine the class and if its annotated with
GraphQLUnion it will return
a GraphQLUnionType.Builder, if its annotated with GraphQLTypeResolver it will return
a GraphQLObjectType otherwise it will return a GraphQLInterfaceType.Builder. |
graphql.schema.GraphQLObjectType |
getObject(java.lang.Class<?> object)
This will examine the object class and return a
GraphQLObjectType representation |
graphql.schema.GraphQLObjectType.Builder |
getObjectBuilder(java.lang.Class<?> object)
This will examine the object class and return a
GraphQLObjectType.Builder ready for further definition |
graphql.schema.GraphQLOutputType |
getObjectOrRef(java.lang.Class<?> object)
This will examine the object class and return a
GraphQLOutputType representation
which may be a GraphQLObjectType or a GraphQLTypeReference |
protected java.util.List<java.lang.reflect.Method> |
getOrderedMethods(java.lang.Class c) |
java.lang.String |
getTypeName(java.lang.Class<?> objectClass) |
java.util.Map<java.lang.String,graphql.schema.GraphQLType> |
getTypeRegistry() |
graphql.schema.GraphQLUnionType.Builder |
getUnionBuilder(java.lang.Class<?> iface)
This will examine the class and return a
GraphQLUnionType.Builder ready for further definition |
static graphql.schema.GraphQLType |
iface(java.lang.Class<?> iface) |
static graphql.schema.GraphQLInterfaceType.Builder |
ifaceBuilder(java.lang.Class<?> iface) |
static graphql.schema.GraphQLInputObjectType |
inputObject(graphql.schema.GraphQLObjectType graphQLType,
java.lang.String newNamePrefix) |
static graphql.schema.GraphQLObjectType |
object(java.lang.Class<?> object) |
static graphql.schema.GraphQLObjectType.Builder |
objectBuilder(java.lang.Class<?> object) |
static void |
register(TypeFunction typeFunction) |
void |
registerType(TypeFunction typeFunction) |
void |
setDefaultTypeFunction(TypeFunction function) |
static graphql.schema.GraphQLUnionType.Builder |
unionBuilder(java.lang.Class<?> iface) |
public static GraphQLAnnotations instance
protected TypeFunction defaultTypeFunction
public GraphQLAnnotations()
public GraphQLAnnotations(TypeFunction defaultTypeFunction)
public static GraphQLAnnotations getInstance()
public graphql.schema.GraphQLType getInterface(java.lang.Class<?> iface)
throws GraphQLAnnotationsException
GraphQLAnnotationsProcessorGraphQLUnion it will return
a GraphQLUnionType.Builder, if its annotated with GraphQLTypeResolver it will return
a GraphQLObjectType otherwise it will return a GraphQLInterfaceType.Builder.getInterface in interface GraphQLAnnotationsProcessoriface - interface to examineGraphQLAnnotationsException - if the interface cannot be examinedpublic static graphql.schema.GraphQLType iface(java.lang.Class<?> iface)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionpublic graphql.schema.GraphQLUnionType.Builder getUnionBuilder(java.lang.Class<?> iface)
throws GraphQLAnnotationsException,
java.lang.IllegalArgumentException
GraphQLAnnotationsProcessorGraphQLUnionType.Builder ready for further definitiongetUnionBuilder in interface GraphQLAnnotationsProcessoriface - interface to examineGraphQLUnionType.BuilderGraphQLAnnotationsException - if the class cannot be examinedjava.lang.IllegalArgumentException - if iface is not an interfacepublic static graphql.schema.GraphQLUnionType.Builder unionBuilder(java.lang.Class<?> iface)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionpublic java.lang.String getTypeName(java.lang.Class<?> objectClass)
public graphql.schema.GraphQLInterfaceType.Builder getIfaceBuilder(java.lang.Class<?> iface)
throws GraphQLAnnotationsException,
java.lang.IllegalArgumentException
GraphQLAnnotationsProcessorGraphQLInterfaceType.Builder ready for further definitiongetIfaceBuilder in interface GraphQLAnnotationsProcessoriface - interface to examineGraphQLInterfaceType.BuilderGraphQLAnnotationsException - if the class cannot be examinedjava.lang.IllegalArgumentException - if iface is not an interfacepublic static graphql.schema.GraphQLInterfaceType.Builder ifaceBuilder(java.lang.Class<?> iface)
throws GraphQLAnnotationsException,
java.lang.IllegalAccessException
GraphQLAnnotationsExceptionjava.lang.IllegalAccessExceptionpublic graphql.schema.GraphQLObjectType getObject(java.lang.Class<?> object)
throws GraphQLAnnotationsException
GraphQLAnnotationsProcessorGraphQLObjectType representationgetObject in interface GraphQLAnnotationsProcessorobject - the object class to examineGraphQLObjectType that represents that object classGraphQLAnnotationsException - if the object class cannot be examinedpublic graphql.schema.GraphQLOutputType getObjectOrRef(java.lang.Class<?> object)
throws GraphQLAnnotationsException
GraphQLAnnotationsProcessorGraphQLOutputType representation
which may be a GraphQLObjectType or a GraphQLTypeReferencegetObjectOrRef in interface GraphQLAnnotationsProcessorobject - the object class to examineGraphQLOutputType that represents that object classGraphQLAnnotationsException - if the object class cannot be examinedpublic static graphql.schema.GraphQLObjectType object(java.lang.Class<?> object)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionpublic graphql.schema.GraphQLObjectType.Builder getObjectBuilder(java.lang.Class<?> object)
throws GraphQLAnnotationsException
GraphQLAnnotationsProcessorGraphQLObjectType.Builder ready for further definitiongetObjectBuilder in interface GraphQLAnnotationsProcessorobject - the object class to examineGraphQLObjectType.Builder that represents that object classGraphQLAnnotationsException - if the object class cannot be examinedpublic static graphql.schema.GraphQLObjectType.Builder objectBuilder(java.lang.Class<?> object)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionprotected java.util.List<java.lang.reflect.Method> getOrderedMethods(java.lang.Class c)
protected java.util.Map<java.lang.String,java.lang.reflect.Field> getAllFields(java.lang.Class c)
protected graphql.schema.GraphQLFieldDefinition getField(java.lang.reflect.Field field)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionprotected graphql.schema.GraphQLFieldDefinition field(java.lang.reflect.Field field)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
java.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionprotected graphql.schema.GraphQLFieldDefinition getField(java.lang.reflect.Method method)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionprotected static graphql.schema.GraphQLFieldDefinition field(java.lang.reflect.Method method)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionpublic graphql.schema.GraphQLInputObjectType getInputObject(graphql.schema.GraphQLObjectType graphQLType,
java.lang.String newNamePrefix)
GraphQLAnnotationsProcessorGraphQLObjectType into a corresponding GraphQLInputObjectTypegetInputObject in interface GraphQLAnnotationsProcessorgraphQLType - the graphql object typenewNamePrefix - since graphql types MUST be unique, this prefix will be applied to the new input typesGraphQLInputObjectTypepublic static graphql.schema.GraphQLInputObjectType inputObject(graphql.schema.GraphQLObjectType graphQLType,
java.lang.String newNamePrefix)
protected graphql.schema.GraphQLArgument getArgument(java.lang.reflect.Parameter parameter,
graphql.schema.GraphQLType t)
throws GraphQLAnnotationsException
GraphQLAnnotationsExceptionpublic void setDefaultTypeFunction(TypeFunction function)
public void registerType(TypeFunction typeFunction)
public static void register(TypeFunction typeFunction)
public java.util.Map<java.lang.String,graphql.schema.GraphQLType> getTypeRegistry()