Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.jexl3;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Manages variables which can be referenced in a JEXL expression.
*
*
JEXL variable names in their simplest form are 'java-like' identifiers.
* JEXL also considers 'ant' inspired variables expressions as valid.
* For instance, the expression 'x.y.z' is an 'antish' variable and will be resolved as a whole by the context,
* i.e. using the key "x.y.z". This proves to be useful to solve "fully qualified class names".
*
*
The interpreter variable resolution algorithm will try the different sequences of identifiers till it finds
* one that exists in the context; if "x" is an object known in the context (JexlContext.has("x") returns true),
* "x.y" will not be looked up in the context but will most likely refer to "x.getY()".
*
*
Note that JEXL may use '$jexl' and '$ujexl' variables for internal purpose; setting or getting those
* variables may lead to unexpected results unless specified otherwise.
*
* @since 1.0
*/
public interface JexlContext {
/**
* A marker interface of the JexlContext that processes annotations.
* It is used by the interpreter during evaluation to execute annotation evaluations.
*
If the JexlContext is not an instance of an AnnotationProcessor, encountering an annotation will generate
* an error or a warning depending on the engine strictness.
* @since 3.1
*/
interface AnnotationProcessor {
/**
* Processes an annotation.
*
All annotations are processed through this method; the statement 'call' is to be performed within
* the processAnnotation method. The implementation must perform the call explicitly.
*
The arguments and the statement must not be referenced or cached for longer than the duration
* of the processAnnotation call.
*
* @param name the annotation name
* @param args the arguments of the annotation, evaluated as arguments of this call
* @param statement the statement that was annotated; the processor should invoke this statement 'call' method
* @return the result of statement.call()
* @throws Exception if annotation processing fails
*/
Object processAnnotation(String name, Object[] args, Callable