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