Class ReferenceCreator
java.lang.Object
io.smallrye.graphql.schema.creator.ReferenceCreator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the scanned references.createReferenceForAdapter(org.jboss.jandex.Type fieldType, Annotations annotations, Direction direction) Get a reference to a field type for an adapter on a fieldcreateReferenceForInterfaceField(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.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)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)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.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.Get the Type auto name strategyvalues(ReferenceType referenceType) Get the values for a certain type
-
Constructor Details
-
ReferenceCreator
-
-
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
Get the values for a certain type- Parameters:
referenceType- the type- Returns:
- the references
-
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 typeannotations- annotation on this operations methoddirection- 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 typeannotationsForMethod- 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 typeannotationsForThisArgument- 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 typeannotationsForThisArgument- 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 typeannotationsForThisMethod- 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 typemethodType- the method typeannotations- the annotations on the field and methoddirection- in or outparentObjectReference- Reference of the parent PoJo use so we can evaluate generics types- Returns:
- a reference to the type
-