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)GraphQLSchemaTraversalControlchangeNode(T schemaElement)Called to change the current node to the specific nodeGraphQLSchemaTraversalControldeleteNode()Called to delete the current nodeGraphQLCodeRegistry.BuildergetCodeRegistry()This will return a value if the visitation call was viaSchemaTransformerTgetElement()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.GraphQLSchemagetSchema()java.util.List<GraphQLSchemaElement>getUnwrappedLeadingElements()This returns the schema element that led to this element but withGraphQLModifiedTypewrappers removed.GraphQLSchemaTraversalControlinsertAfter(T toInsertAfter)Called to insert the current schema element after the specified schema elementGraphQLSchemaTraversalControlinsertBefore(T toInsertBefore)Called to insert the current schema element before the specified schema elementGraphQLSchemaTraversalControlok()GraphQLSchemaTraversalControlquit()
-
-
-
Field Detail
-
context
protected final TraverserContext<GraphQLSchemaElement> context
-
-
Constructor Detail
-
GraphQLSchemaVisitorEnvironmentImpl
GraphQLSchemaVisitorEnvironmentImpl(TraverserContext<GraphQLSchemaElement> context)
-
-
Method Detail
-
getSchema
public GraphQLSchema getSchema()
- Specified by:
getSchemain interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Returns:
- the schema that is being visited upon
-
getCodeRegistry
public GraphQLCodeRegistry.Builder getCodeRegistry()
Description copied from interface:GraphQLSchemaVisitorEnvironmentThis will return a value if the visitation call was viaSchemaTransformer- Specified by:
getCodeRegistryin interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Returns:
- a code registry builder
-
getElement
public T getElement()
- Specified by:
getElementin interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Returns:
- the element that is being visited
-
getLeadingElements
public java.util.List<GraphQLSchemaElement> getLeadingElements()
Description copied from interface:GraphQLSchemaVisitorEnvironmentThis 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:
getLeadingElementsin 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:GraphQLSchemaVisitorEnvironmentThis returns the schema element that led to this element but withGraphQLModifiedTypewrappers removed.- Specified by:
getUnwrappedLeadingElementsin 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:
okin interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Returns:
- When returned the traversal will continue as planned.
-
quit
public GraphQLSchemaTraversalControl quit()
- Specified by:
quitin 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:GraphQLSchemaVisitorEnvironmentCalled to change the current node to the specific node- Specified by:
changeNodein 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:GraphQLSchemaVisitorEnvironmentCalled to delete the current node- Specified by:
deleteNodein interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Returns:
- a control that deletes the current node
-
insertAfter
public GraphQLSchemaTraversalControl insertAfter(T toInsertAfter)
Description copied from interface:GraphQLSchemaVisitorEnvironmentCalled to insert the current schema element after the specified schema element- Specified by:
insertAfterin 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:GraphQLSchemaVisitorEnvironmentCalled to insert the current schema element before the specified schema element- Specified by:
insertBeforein interfaceGraphQLSchemaVisitorEnvironment<T extends GraphQLSchemaElement>- Parameters:
toInsertBefore- the schema element to insert before- Returns:
- a control that inserts the given node before the current node
-
-