Package graphql.schema.impl
Class MultiReadOnlyGraphQLTypeVisitor
- java.lang.Object
-
- graphql.schema.impl.MultiReadOnlyGraphQLTypeVisitor
-
- All Implemented Interfaces:
GraphQLTypeVisitor
public class MultiReadOnlyGraphQLTypeVisitor extends java.lang.Object implements GraphQLTypeVisitor
A delegating type visitor that allows you to call N visitors in a list and always continues viaTraversalControl.CONTINUE
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<GraphQLTypeVisitor>visitors
-
Constructor Summary
Constructors Constructor Description MultiReadOnlyGraphQLTypeVisitor(java.util.List<GraphQLTypeVisitor> visitors)
-
Method Summary
-
-
-
Field Detail
-
visitors
private final java.util.List<GraphQLTypeVisitor> visitors
-
-
Constructor Detail
-
MultiReadOnlyGraphQLTypeVisitor
public MultiReadOnlyGraphQLTypeVisitor(java.util.List<GraphQLTypeVisitor> visitors)
-
-
Method Detail
-
visitGraphQLAppliedDirective
public TraversalControl visitGraphQLAppliedDirective(GraphQLAppliedDirective node, TraverserContext<GraphQLSchemaElement> context)
Description copied from interface:GraphQLTypeVisitorThis method will be called when a directive is applied to a schema element. TheTraverserContext.getParentNode()will be the schema element that this is applied to. The graphql-java code base is trying to slowly move away from usingGraphQLDirectives when they really should beGraphQLAppliedDirectives- Specified by:
visitGraphQLAppliedDirectivein interfaceGraphQLTypeVisitor- Parameters:
node- the applied directivecontext- the traversal context- Returns:
- how to control the visitation processing
-
visitGraphQLAppliedDirectiveArgument
public TraversalControl visitGraphQLAppliedDirectiveArgument(GraphQLAppliedDirectiveArgument node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLAppliedDirectiveArgumentin interfaceGraphQLTypeVisitor
-
visitGraphQLArgument
public TraversalControl visitGraphQLArgument(GraphQLArgument node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLArgumentin interfaceGraphQLTypeVisitor
-
visitGraphQLInterfaceType
public TraversalControl visitGraphQLInterfaceType(GraphQLInterfaceType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInterfaceTypein interfaceGraphQLTypeVisitor
-
visitGraphQLEnumType
public TraversalControl visitGraphQLEnumType(GraphQLEnumType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLEnumTypein interfaceGraphQLTypeVisitor
-
visitGraphQLEnumValueDefinition
public TraversalControl visitGraphQLEnumValueDefinition(GraphQLEnumValueDefinition node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLEnumValueDefinitionin interfaceGraphQLTypeVisitor
-
visitGraphQLFieldDefinition
public TraversalControl visitGraphQLFieldDefinition(GraphQLFieldDefinition node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLFieldDefinitionin interfaceGraphQLTypeVisitor
-
visitGraphQLDirective
public TraversalControl visitGraphQLDirective(GraphQLDirective node, TraverserContext<GraphQLSchemaElement> context)
Description copied from interface:GraphQLTypeVisitorThis method will be called twice. Once for a directive definition in a schema and then do each time a directive is applied to a schema element When it's applied to a schema element thenTraverserContext.getParentNode()will be the schema element that this is applied to. The graphql-java code base is trying to slowly move away from usingGraphQLDirectives when they really should beGraphQLAppliedDirectives and this is another place that has been left in. In the future this behavior will change and this will only visit directive definitions of a schema, not where they are applied.- Specified by:
visitGraphQLDirectivein interfaceGraphQLTypeVisitor- Parameters:
node- the directivecontext- the traversal context- Returns:
- how to control the visitation processing
-
visitGraphQLInputObjectField
public TraversalControl visitGraphQLInputObjectField(GraphQLInputObjectField node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputObjectFieldin interfaceGraphQLTypeVisitor
-
visitGraphQLInputObjectType
public TraversalControl visitGraphQLInputObjectType(GraphQLInputObjectType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputObjectTypein interfaceGraphQLTypeVisitor
-
visitGraphQLList
public TraversalControl visitGraphQLList(GraphQLList node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLListin interfaceGraphQLTypeVisitor
-
visitGraphQLNonNull
public TraversalControl visitGraphQLNonNull(GraphQLNonNull node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLNonNullin interfaceGraphQLTypeVisitor
-
visitGraphQLObjectType
public TraversalControl visitGraphQLObjectType(GraphQLObjectType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLObjectTypein interfaceGraphQLTypeVisitor
-
visitGraphQLScalarType
public TraversalControl visitGraphQLScalarType(GraphQLScalarType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLScalarTypein interfaceGraphQLTypeVisitor
-
visitGraphQLTypeReference
public TraversalControl visitGraphQLTypeReference(GraphQLTypeReference node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLTypeReferencein interfaceGraphQLTypeVisitor
-
visitGraphQLUnionType
public TraversalControl visitGraphQLUnionType(GraphQLUnionType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLUnionTypein interfaceGraphQLTypeVisitor
-
visitBackRef
public TraversalControl visitBackRef(TraverserContext<GraphQLSchemaElement> context)
Description copied from interface:GraphQLTypeVisitorCalled when a node is visited more than once within a context.TraverserContext.thisNode()contains the node- Specified by:
visitBackRefin interfaceGraphQLTypeVisitor- Parameters:
context- the traversal context- Returns:
- by default CONTINUE
-
visitGraphQLModifiedType
public TraversalControl visitGraphQLModifiedType(GraphQLModifiedType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLModifiedTypein interfaceGraphQLTypeVisitor
-
visitGraphQLCompositeType
public TraversalControl visitGraphQLCompositeType(GraphQLCompositeType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLCompositeTypein interfaceGraphQLTypeVisitor
-
visitGraphQLDirectiveContainer
public TraversalControl visitGraphQLDirectiveContainer(GraphQLDirectiveContainer node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLDirectiveContainerin interfaceGraphQLTypeVisitor
-
visitGraphQLFieldsContainer
public TraversalControl visitGraphQLFieldsContainer(GraphQLFieldsContainer node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLFieldsContainerin interfaceGraphQLTypeVisitor
-
visitGraphQLInputFieldsContainer
public TraversalControl visitGraphQLInputFieldsContainer(GraphQLInputFieldsContainer node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputFieldsContainerin interfaceGraphQLTypeVisitor
-
visitGraphQLInputType
public TraversalControl visitGraphQLInputType(GraphQLInputType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputTypein interfaceGraphQLTypeVisitor
-
visitGraphQLNullableType
public TraversalControl visitGraphQLNullableType(GraphQLNullableType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLNullableTypein interfaceGraphQLTypeVisitor
-
visitGraphQLOutputType
public TraversalControl visitGraphQLOutputType(GraphQLOutputType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLOutputTypein interfaceGraphQLTypeVisitor
-
visitGraphQLUnmodifiedType
public TraversalControl visitGraphQLUnmodifiedType(GraphQLUnmodifiedType node, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLUnmodifiedTypein interfaceGraphQLTypeVisitor
-
changeNode
public TraversalControl changeNode(TraverserContext<GraphQLSchemaElement> context, GraphQLSchemaElement newChangedNode)
Description copied from interface:GraphQLTypeVisitorThis helper method can be used to "change" a node when returning control from this visitor- Specified by:
changeNodein interfaceGraphQLTypeVisitor- Parameters:
context- the current traversal contextnewChangedNode- the new to be changed at this place- Returns:
- this will always sent back TraversalControl.CONTINUE
-
deleteNode
public TraversalControl deleteNode(TraverserContext<GraphQLSchemaElement> context)
Description copied from interface:GraphQLTypeVisitorThis helper method can be used to "delete" the current node when returning control from this visitor- Specified by:
deleteNodein interfaceGraphQLTypeVisitor- Parameters:
context- the current traversal context which is pointing to the current node to be deleted- Returns:
- this will always sent back TraversalControl.CONTINUE
-
insertAfter
public TraversalControl insertAfter(TraverserContext<GraphQLSchemaElement> context, GraphQLSchemaElement toInsertAfter)
Description copied from interface:GraphQLTypeVisitorThis helper method can be used to "insert a new node" AFTER the current node when returning control from this visitor- Specified by:
insertAfterin interfaceGraphQLTypeVisitor- Parameters:
context- the current traversal contexttoInsertAfter- the new to be inserted AFTER this current code- Returns:
- this will always sent back TraversalControl.CONTINUE
-
insertBefore
public TraversalControl insertBefore(TraverserContext<GraphQLSchemaElement> context, GraphQLSchemaElement toInsertBefore)
Description copied from interface:GraphQLTypeVisitorThis helper method can be used to "insert a new node" BEFORE the current node when returning control from this visitor- Specified by:
insertBeforein interfaceGraphQLTypeVisitor- Parameters:
context- the current traversal contexttoInsertBefore- the new to be inserted BEFORE this current code- Returns:
- this will always sent back TraversalControl.CONTINUE
-
-