Class FieldCreator


  • public class FieldCreator
    extends ModelCreator
    Creates a Field object
    Author:
    Phillip Kruger (phillip.kruger@redhat.com)
    • Constructor Detail

    • 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 method
        parentObjectReference -
        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 property
        methodInfo - 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 otherwise
        fieldInfo - the field. If null, methodInfo must be provided
        methodInfo - the method. If null, fieldInfo must be provided
        Returns:
        if it is an GraphQL field