Package graphql.schema.visitor
Class GraphQLSchemaVisitorEnvironmentImpl<T extends GraphQLSchemaElement>
- java.lang.Object
-
- graphql.schema.visitor.GraphQLSchemaVisitorEnvironmentImpl<T>
-
- All Implemented Interfaces:
GraphQLSchemaVisitorEnvironment<T>
- Direct Known Subclasses:
GraphQLSchemaVisitorAdapter.AppliedDirectiveArgumentEnv
,GraphQLSchemaVisitorAdapter.AppliedDirectiveEnv
,GraphQLSchemaVisitorAdapter.ArgumentEnv
,GraphQLSchemaVisitorAdapter.DirectiveEnv
,GraphQLSchemaVisitorAdapter.EnumTypeEnv
,GraphQLSchemaVisitorAdapter.EnumValueDefinitionEnv
,GraphQLSchemaVisitorAdapter.FieldDefinitionEnv
,GraphQLSchemaVisitorAdapter.InputObjectFieldEnv
,GraphQLSchemaVisitorAdapter.InputObjectTypeEnv
,GraphQLSchemaVisitorAdapter.InterfaceTypeEnv
,GraphQLSchemaVisitorAdapter.ObjectEnv
,GraphQLSchemaVisitorAdapter.ScalarTypeEnv
,GraphQLSchemaVisitorAdapter.SchemaElementEnv
,GraphQLSchemaVisitorAdapter.UnionTypeEnv
class GraphQLSchemaVisitorEnvironmentImpl<T extends GraphQLSchemaElement> extends java.lang.Object implements GraphQLSchemaVisitorEnvironment<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected TraverserContext<GraphQLSchemaElement>
context
-
Constructor Summary
Constructors Constructor Description GraphQLSchemaVisitorEnvironmentImpl(TraverserContext<GraphQLSchemaElement> context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private @NotNull java.util.List<GraphQLSchemaElement>
buildParentsImpl(java.util.function.Predicate<GraphQLSchemaElement> predicate)
GraphQLSchemaTraversalControl
changeNode(T schemaElement)
Called to change the current node to the specific nodeGraphQLSchemaTraversalControl
deleteNode()
Called to delete the current nodeGraphQLCodeRegistry.Builder
getCodeRegistry()
This will return a value if the visitation call was viaSchemaTransformer
T
getElement()
java.util.List<GraphQLSchemaElement>
getLeadingElements()
This returns the schema element that led to this element, eg a field is contained in a type which is pointed to be another field say.GraphQLSchema
getSchema()
java.util.List<GraphQLSchemaElement>
getUnwrappedLeadingElements()
This returns the schema element that led to this element but withGraphQLModifiedType
wrappers removed.GraphQLSchemaTraversalControl
insertAfter(T toInsertAfter)
Called to insert the current schema element after the specified schema elementGraphQLSchemaTraversalControl
insertBefore(T toInsertBefore)
Called to insert the current schema element before the specified schema elementGraphQLSchemaTraversalControl
ok()
GraphQLSchemaTraversalControl
quit()
-
-
-
Field Detail
-
context
protected final TraverserContext<GraphQLSchemaElement> context
-
-
Constructor Detail
-
GraphQLSchemaVisitorEnvironmentImpl
GraphQLSchemaVisitorEnvironmentImpl(TraverserContext<GraphQLSchemaElement> context)
-
-
Method Detail
-
getSchema
public GraphQLSchema getSchema()
- Specified by:
getSchema
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- the schema that is being visited upon
-
getCodeRegistry
public GraphQLCodeRegistry.Builder getCodeRegistry()
Description copied from interface:GraphQLSchemaVisitorEnvironment
This will return a value if the visitation call was viaSchemaTransformer
- Specified by:
getCodeRegistry
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- a code registry builder
-
getElement
public T getElement()
- Specified by:
getElement
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- the element that is being visited
-
getLeadingElements
public java.util.List<GraphQLSchemaElement> getLeadingElements()
Description copied from interface:GraphQLSchemaVisitorEnvironment
This returns the schema element that led to this element, eg a field is contained in a type which is pointed to be another field say.- Specified by:
getLeadingElements
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- a list of schema elements leading to this current element
-
getUnwrappedLeadingElements
public java.util.List<GraphQLSchemaElement> getUnwrappedLeadingElements()
Description copied from interface:GraphQLSchemaVisitorEnvironment
This returns the schema element that led to this element but withGraphQLModifiedType
wrappers removed.- Specified by:
getUnwrappedLeadingElements
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- a list of schema elements leading to this current element
-
buildParentsImpl
@NotNull private @NotNull java.util.List<GraphQLSchemaElement> buildParentsImpl(java.util.function.Predicate<GraphQLSchemaElement> predicate)
-
ok
public GraphQLSchemaTraversalControl ok()
- Specified by:
ok
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- When returned the traversal will continue as planned.
-
quit
public GraphQLSchemaTraversalControl quit()
- Specified by:
quit
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- When returned from a
GraphQLSchemaVisitor
's method, indicates exiting the traversal.
-
changeNode
public GraphQLSchemaTraversalControl changeNode(T schemaElement)
Description copied from interface:GraphQLSchemaVisitorEnvironment
Called to change the current node to the specific node- Specified by:
changeNode
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Parameters:
schemaElement
- the schema element to change- Returns:
- a control that changes the current node to a the given node
-
deleteNode
public GraphQLSchemaTraversalControl deleteNode()
Description copied from interface:GraphQLSchemaVisitorEnvironment
Called to delete the current node- Specified by:
deleteNode
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Returns:
- a control that deletes the current node
-
insertAfter
public GraphQLSchemaTraversalControl insertAfter(T toInsertAfter)
Description copied from interface:GraphQLSchemaVisitorEnvironment
Called to insert the current schema element after the specified schema element- Specified by:
insertAfter
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Parameters:
toInsertAfter
- the schema element to after before- Returns:
- a control that inserts the given node after the current node
-
insertBefore
public GraphQLSchemaTraversalControl insertBefore(T toInsertBefore)
Description copied from interface:GraphQLSchemaVisitorEnvironment
Called to insert the current schema element before the specified schema element- Specified by:
insertBefore
in interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>
- Parameters:
toInsertBefore
- the schema element to insert before- Returns:
- a control that inserts the given node before the current node
-
-