Class FieldCreator
java.lang.Object
io.smallrye.graphql.schema.creator.ModelCreator
io.smallrye.graphql.schema.creator.FieldCreator
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 -
Method Summary
Modifier and TypeMethodDescriptioncreateFieldForInterface(org.jboss.jandex.MethodInfo methodInfo, Reference parentObjectReference) Creates a field from a method only.This is used in the case of an interfacecreateFieldForParameter(org.jboss.jandex.MethodInfo method, short position, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference) createFieldForPojo(Direction direction, org.jboss.jandex.FieldInfo fieldInfo, Reference parentObjectReference) Creates a field from a public 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 Details
-
FieldCreator
-
-
Method Details
-
getDirectiveLocation
- Specified by:
getDirectiveLocationin classModelCreator
-
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
-
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
-