1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.core.model;
7   
8   import edu.umd.cs.findbugs.annotations.NonNull;
9   
10  /**
11   * Represents a model element that can be visited using the visitor pattern.
12   * <p>
13   * This interface supports traversal of model elements using implementations of
14   * {@link IModelElementVisitor}.
15   */
16  @FunctionalInterface
17  public interface IModelElementVisitable {
18    /**
19     * A visitor callback.
20     *
21     * @param <CONTEXT>
22     *          the type of the context parameter
23     * @param <RESULT>
24     *          the type of the visitor result
25     * @param visitor
26     *          the calling visitor
27     * @param context
28     *          a parameter used to pass contextual information between visitors
29     * @return the visitor result
30     */
31    <CONTEXT, RESULT> RESULT accept(@NonNull IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context);
32  }