001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package dev.metaschema.core.model; 007 008import edu.umd.cs.findbugs.annotations.NonNull; 009 010/** 011 * Represents a model element that can be visited using the visitor pattern. 012 * <p> 013 * This interface supports traversal of model elements using implementations of 014 * {@link IModelElementVisitor}. 015 */ 016@FunctionalInterface 017public interface IModelElementVisitable { 018 /** 019 * A visitor callback. 020 * 021 * @param <CONTEXT> 022 * the type of the context parameter 023 * @param <RESULT> 024 * the type of the visitor result 025 * @param visitor 026 * the calling visitor 027 * @param context 028 * a parameter used to pass contextual information between visitors 029 * @return the visitor result 030 */ 031 <CONTEXT, RESULT> RESULT accept(@NonNull IModelElementVisitor<CONTEXT, RESULT> visitor, CONTEXT context); 032}