Package graphql.schema
Class SchemaTraverser
- java.lang.Object
-
- graphql.schema.SchemaTraverser
-
@PublicApi public class SchemaTraverser extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SchemaTraverser.TraverserDelegateListVisitor
private static class
SchemaTraverser.TraverserDelegateVisitor
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<? super GraphQLSchemaElement,? extends java.util.List<GraphQLSchemaElement>>
getChildren
-
Constructor Summary
Constructors Constructor Description SchemaTraverser()
SchemaTraverser(java.util.function.Function<? super GraphQLSchemaElement,? extends java.util.List<GraphQLSchemaElement>> getChildren)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraverserResult
depthFirst(GraphQLTypeVisitor graphQLTypeVisitor, GraphQLSchemaElement root)
TraverserResult
depthFirst(GraphQLTypeVisitor graphQLTypeVisitor, java.util.Collection<? extends GraphQLSchemaElement> roots)
TraverserResult
depthFirst(Traverser<GraphQLSchemaElement> traverser, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor, java.util.Collection<? extends GraphQLSchemaElement> roots)
TraverserResult
depthFirstFullSchema(GraphQLTypeVisitor typeVisitor, GraphQLSchema schema)
This will visit all of the schema elements in the specified schema and invokes the visitor.TraverserResult
depthFirstFullSchema(java.util.List<GraphQLTypeVisitor> typeVisitors, GraphQLSchema schema, java.util.Map<java.lang.Class<?>,java.lang.Object> rootVars)
This will visit all of the schema elements in the specified schema, invoking each visitor in turn.private TraverserResult
doTraverse(Traverser<GraphQLSchemaElement> traverser, java.util.Collection<? extends GraphQLSchemaElement> roots, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor)
private Traverser<GraphQLSchemaElement>
initTraverser()
-
-
-
Field Detail
-
getChildren
private final java.util.function.Function<? super GraphQLSchemaElement,? extends java.util.List<GraphQLSchemaElement>> getChildren
-
-
Constructor Detail
-
SchemaTraverser
public SchemaTraverser(java.util.function.Function<? super GraphQLSchemaElement,? extends java.util.List<GraphQLSchemaElement>> getChildren)
-
SchemaTraverser
public SchemaTraverser()
-
-
Method Detail
-
depthFirstFullSchema
public TraverserResult depthFirstFullSchema(GraphQLTypeVisitor typeVisitor, GraphQLSchema schema)
This will visit all of the schema elements in the specified schema and invokes the visitor.- Parameters:
typeVisitor
- a list of visitors to useschema
- the schema to visit- Returns:
- a traversal result
-
depthFirstFullSchema
public TraverserResult depthFirstFullSchema(java.util.List<GraphQLTypeVisitor> typeVisitors, GraphQLSchema schema, java.util.Map<java.lang.Class<?>,java.lang.Object> rootVars)
This will visit all of the schema elements in the specified schema, invoking each visitor in turn.- Parameters:
typeVisitors
- a list of visitors to useschema
- the schema to visitrootVars
- this sets up variables to be made available to theTraverserContext
. This can be empty but not null- Returns:
- a traversal result
-
depthFirst
public TraverserResult depthFirst(GraphQLTypeVisitor graphQLTypeVisitor, GraphQLSchemaElement root)
-
depthFirst
public TraverserResult depthFirst(GraphQLTypeVisitor graphQLTypeVisitor, java.util.Collection<? extends GraphQLSchemaElement> roots)
-
depthFirst
public TraverserResult depthFirst(Traverser<GraphQLSchemaElement> traverser, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor, java.util.Collection<? extends GraphQLSchemaElement> roots)
-
initTraverser
private Traverser<GraphQLSchemaElement> initTraverser()
-
doTraverse
private TraverserResult doTraverse(Traverser<GraphQLSchemaElement> traverser, java.util.Collection<? extends GraphQLSchemaElement> roots, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor)
-
-