001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 // 021 // This source code implements specifications defined by the Java 022 // Community Process. In order to remain compliant with the specification 023 // DO NOT add / change / or delete method signatures! 024 // 025 026 package javax.servlet.jsp.el; 027 028 029 /** 030 * <p>The abstract class for a prepared expression.</p> 031 * 032 * <p>An instance of an Expression can be obtained via from an 033 * ExpressionEvaluator instance.</p> 034 * 035 * <p>An Expression may or not have done a syntactic parse of the expression. 036 * A client invoking the evaluate() method should be ready for the case 037 * where ELParseException exceptions are raised. </p> 038 * 039 * @since 2.0 040 */ 041 public abstract class Expression { 042 043 /** 044 * Evaluates an expression that was previously prepared. In some 045 * implementations preparing an expression involves full syntactic 046 * validation, but others may not do so. Evaluating the expression may 047 * raise an ELParseException as well as other ELExceptions due to 048 * run-time evaluation. 049 * 050 * @param vResolver A VariableResolver instance that can be used at 051 * runtime to resolve the name of implicit objects into Objects. 052 * @return The result of the expression evaluation. 053 * 054 * @exception ELException Thrown if the expression evaluation failed. 055 */ 056 public abstract Object evaluate( VariableResolver vResolver ) 057 throws ELException; 058 } 059