Class ReferenceCreator

java.lang.Object
io.smallrye.graphql.schema.creator.ReferenceCreator

public class ReferenceCreator extends Object
Here we create references to things that might not yet exist. We store all references to be created later.
Author:
Phillip Kruger (phillip.kruger@redhat.com)
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Clear the scanned references. This is done when we created all references and do not need to remember what to scan.
    • values

      public Queue<Reference> values(ReferenceType referenceType)
      Get the values for a certain type
      Parameters:
      referenceType - the type
      Returns:
      the references
    • getTypeAutoNameStrategy

      public TypeAutoNameStrategy getTypeAutoNameStrategy()
      Get the Type auto name strategy
      Returns:
      the strategy as supplied
    • createReferenceForAdapter

      public Reference createReferenceForAdapter(org.jboss.jandex.Type fieldType, Annotations annotations, Direction direction)
      Get a reference to a field type for an adapter on a field
      Parameters:
      fieldType - the java type
      annotations - annotation on this operations method
      direction - the direction
      Returns:
      a reference to the type
    • createReferenceForOperationField

      public Reference createReferenceForOperationField(org.jboss.jandex.Type fieldType, Annotations annotationsForMethod)
      Get a reference to a field type for an operation Direction is OUT on a field (and IN on an argument) In the case of operations, there is no fields (only methods)
      Parameters:
      fieldType - the java type
      annotationsForMethod - annotation on this operations method
      Returns:
      a reference to the type
    • createReferenceForOperationArgument

      public Reference createReferenceForOperationArgument(org.jboss.jandex.Type argumentType, Annotations annotationsForThisArgument)
      Get a reference to a argument type for an operation Direction is IN on an argument (and OUT on a field) In the case of operation, there is no field (only methods)
      Parameters:
      argumentType - the java type
      annotationsForThisArgument - annotations on this argument
      Returns:
      a reference to the argument
    • createReferenceForSourceArgument

      public Reference createReferenceForSourceArgument(org.jboss.jandex.Type argumentType, Annotations annotationsForThisArgument)
      Get a reference to a source argument type for an operation Direction is OUT on an argument.
      Parameters:
      argumentType - the java type
      annotationsForThisArgument - annotations on this argument
      Returns:
      a reference to the argument
    • createReferenceForInterfaceField

      public Reference createReferenceForInterfaceField(org.jboss.jandex.Type methodType, Annotations annotationsForThisMethod, Reference parentObjectReference)
      Get a reference to a field (method response) on an interface Interfaces is only usable on Type, so the direction in OUT.
      Parameters:
      methodType - the method response type
      annotationsForThisMethod - annotations on this method
      Returns:
      a reference to the type
    • createReferenceForPojoField

      public Reference createReferenceForPojoField(org.jboss.jandex.Type fieldType, org.jboss.jandex.Type methodType, Annotations annotations, Direction direction, Reference parentObjectReference)
      Get a reference to a Field Type for a InputType or Type. We need both the type and the getter/setter method as both is applicable.
      Parameters:
      fieldType - the field type
      methodType - the method type
      annotations - the annotations on the field and method
      direction - in or out
      parentObjectReference - Reference of the parent PoJo use so we can evaluate generics types
      Returns:
      a reference to the type