| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2009 - 2010 Cloudsmith Inc. and others. |
| 3 |
* |
| 4 |
* This program and the accompanying materials |
| 5 |
* are made available under the terms of the Eclipse Public License 2.0 |
| 6 |
* which accompanies this distribution, and is available at |
| 7 |
* https://www.eclipse.org/legal/epl-2.0/ |
| 8 |
* |
| 9 |
* SPDX-License-Identifier: EPL-2.0 |
| 10 |
* |
| 11 |
* Contributors: |
| 12 |
* Cloudsmith Inc. - initial API and implementation |
| 13 |
*******************************************************************************/ |
| 14 |
package org.eclipse.equinox.p2.metadata.expression; |
| 15 |
|
| 16 |
import org.eclipse.equinox.p2.metadata.index.IIndexProvider; |
| 17 |
|
| 18 |
/** |
| 19 |
* The evaluation context. Contexts can be nested and new contexts are pushed for each closure |
| 20 |
* during an evaluation of an expression. |
| 21 |
* @since 2.0 |
| 22 |
*/ |
| 23 |
public interface IEvaluationContext { |
| 24 |
IIndexProvider<?> getIndexProvider(); |
| 25 |
|
| 26 |
void setIndexProvider(IIndexProvider<?> indexProvider); |
| 27 |
|
| 28 |
/** |
| 29 |
* Retrieve the value of the given <code>variable</code> from this context |
| 30 |
* @param variable The variable who's value should be retrieved |
| 31 |
* @return The current value for the variable |
| 32 |
*/ |
| 33 |
Object getValue(IExpression variable); |
| 34 |
|
| 35 |
/** |
| 36 |
* Set the current value for the given <code>variable</code> to <code>value</code> |
| 37 |
* @param variable The variable who's value should be set |
| 38 |
* @param value The new value for the variable. |
| 39 |
*/ |
| 40 |
void setValue(IExpression variable, Object value); |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns the value of the parameter at the given <code>position</code> |
| 44 |
* @param position The zero based position for the parameter |
| 45 |
* @return The parameter value |
| 46 |
*/ |
| 47 |
Object getParameter(int position); |
| 48 |
} |