001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  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    package org.apache.commons.el;
018    
019    import javax.servlet.jsp.el.ELException;
020    import javax.servlet.jsp.el.FunctionMapper;
021    import javax.servlet.jsp.el.VariableResolver;
022    
023    /**
024     *
025     * <p>An expression representing a literal value
026     * 
027     * @author Nathan Abramson - Art Technology Group
028     * @author Shawn Bayern
029     * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: bayard $
030     **/
031    
032    public abstract class Literal
033      extends Expression
034    {
035      //-------------------------------------
036      // Properties
037      //-------------------------------------
038      // property value
039    
040      Object mValue;
041      public Object getValue ()
042      { return mValue; }
043      public void setValue (Object pValue)
044      { mValue = pValue; }
045    
046      //-------------------------------------
047      /**
048       *
049       * Constructor
050       **/
051      public Literal (Object pValue)
052      {
053        mValue = pValue;
054      }
055    
056      //-------------------------------------
057      // Expression methods
058      //-------------------------------------
059      /**
060       *
061       * Evaluates to the literal value
062       **/
063      public Object evaluate (VariableResolver pResolver, FunctionMapper functions)
064        throws ELException
065      {
066        return mValue;
067      }
068    
069      public Expression bindFunctions(FunctionMapper functions) throws ELException {
070          return this;
071      }
072       
073    
074      //-------------------------------------
075    }