Class FieldCreator
- java.lang.Object
-
- io.smallrye.graphql.schema.creator.ModelCreator
-
- io.smallrye.graphql.schema.creator.FieldCreator
-
public class FieldCreator extends ModelCreator
Creates a Field object- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
-
Field Summary
-
Fields inherited from class io.smallrye.graphql.schema.creator.ModelCreator
directives, referenceCreator
-
-
Constructor Summary
Constructors Constructor Description FieldCreator(ReferenceCreator referenceCreator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Field>createFieldForInterface(org.jboss.jandex.MethodInfo methodInfo, Reference parentObjectReference)Creates a field from a method only.This is used in the case of an interfaceOptional<Field>createFieldForParameter(org.jboss.jandex.MethodInfo method, short position, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference)Optional<Field>createFieldForPojo(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference)Creates a field from a public field.Optional<Field>createFieldForPojo(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, org.jboss.jandex.MethodInfo methodInfo, Reference parentObjectReference)Creates a field from a field and method.protected static booleanisGraphQlField(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, org.jboss.jandex.MethodInfo methodInfo)Checks if method and/or field are use-able as a GraphQL-Field.-
Methods inherited from class io.smallrye.graphql.schema.creator.ModelCreator
getReferenceCreator, getReturnType, getReturnType, getTypeAutoNameStrategy, populateField, populateField, setDirectives
-
-
-
-
Constructor Detail
-
FieldCreator
public FieldCreator(ReferenceCreator referenceCreator)
-
-
Method Detail
-
createFieldForInterface
public Optional<Field> createFieldForInterface(org.jboss.jandex.MethodInfo methodInfo, Reference parentObjectReference)
Creates a field from a method only.This is used in the case of an interface- Parameters:
methodInfo- the java methodparentObjectReference-- Returns:
- a Field model object
-
createFieldForPojo
public Optional<Field> createFieldForPojo(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, org.jboss.jandex.MethodInfo methodInfo, Reference parentObjectReference)
Creates a field from a field and method. Used by Type and Input- Parameters:
direction- the direction (in/out)fieldInfo- the java propertymethodInfo- the java method- Returns:
- a Field model object
-
createFieldForParameter
public Optional<Field> createFieldForParameter(org.jboss.jandex.MethodInfo method, short position, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference)
-
createFieldForPojo
public Optional<Field> createFieldForPojo(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference)
Creates a field from a public field. Used by Type and Input- Parameters:
direction- the direction (in/out)fieldInfo- the java property- Returns:
- a Field model object
-
isGraphQlField
protected static boolean isGraphQlField(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, org.jboss.jandex.MethodInfo methodInfo)
Checks if method and/or field are use-able as a GraphQL-Field.- Parameters:
direction- the direction, IN if the field should be used on an input type, OUT otherwisefieldInfo- the field. If null, methodInfo must be providedmethodInfo- the method. If null, fieldInfo must be provided- Returns:
- if it is an GraphQL field
-
-