All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.util.TraverserVisitor Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.util;

import graphql.Internal;

@Internal
public interface TraverserVisitor {

    /**
     * @param context the context in place
     *
     * @return Any allowed control value
     */
    TraversalControl enter(TraverserContext context);

    /**
     * @param context the context in place
     *
     * @return Only Continue or Quit allowed
     */
    TraversalControl leave(TraverserContext context);

    /**
     * This method is called when a node was already visited before.
     *
     * This can happen for two reasons:
     * 1. There is a cycle.
     * 2. A node has more than one parent. This means the structure is not a tree but a graph.
     *
     * @param context the context in place
     *
     * @return Only Continue or Quit allowed
     */
    default TraversalControl backRef(TraverserContext context) {
        return TraversalControl.CONTINUE;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy