/* * 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.el;
/** * An <code>Expression</code> that can get or set a value. * * <p> * In previous incarnations of this API, expressions could only be read. * <code>ValueExpression</code> objects can now be used both to retrieve a * value and to set a value. Expressions that can have a value set on them are * referred to as l-value expressions. Those that cannot are referred to as * r-value expressions. Not all r-value expressions can be used as l-value * expressions (e.g. <code>"${1+1}"</code> or * <code>"${firstName} ${lastName}"</code>). See the EL Specification for * details. Expressions that cannot be used as l-values must always return * <code>true</code> from <code>isReadOnly()</code>. * </p> * * <p> * The {@link jakarta.el.ExpressionFactory#createValueExpression} method * can be used to parse an expression string and return a concrete instance * of <code>ValueExpression</code> that encapsulates the parsed expression. * The {@link FunctionMapper} is used at parse time, not evaluation time, * so one is not needed to evaluate an expression using this class. * However, the {@link ELContext} is needed at evaluation time.</p> * * <p>The {@link #getValue}, {@link #setValue}, {@link #isReadOnly} and * {@link #getType} methods will evaluate the expression each time they are * called. The {@link jakarta.el.ELResolver} in the <code>ELContext</code> is used * to resolve the top-level variables and to determine the behavior of the * <code>.</code> and <code>[]</code> operators. For any of the four methods, * the {@link jakarta.el.ELResolver#getValue} method is used to resolve all * properties up to but excluding the last one. This provides the * <code>base</code> object. At the last resolution, the * <code>ValueExpression</code> will call the corresponding * {@link jakarta.el.ELResolver#getValue}, {@link jakarta.el.ELResolver#setValue}, * {@link jakarta.el.ELResolver#isReadOnly} or {@link jakarta.el.ELResolver#getType} * method, depending on which was called on the <code>ValueExpression</code>. * </p> * * <p>See the notes about comparison, serialization and immutability in * the {@link jakarta.el.Expression} javadocs. * * @see jakarta.el.ELResolver * @see jakarta.el.Expression * @see jakarta.el.ExpressionFactory * @see jakarta.el.ValueExpression * * @author Jacob Hookom [jacob@hookom.net]
*/ publicfinalclass ValueExpressionImpl extends ValueExpression implements
Externalizable {
/** * Returns the type the result of the expression will be coerced to after * evaluation. * * @return the <code>expectedType</code> passed to the * <code>ExpressionFactory.createValueExpression</code> method * that created this <code>ValueExpression</code>. * * @see jakarta.el.Expression#getExpressionString()
*/
@Override public String getExpressionString() { returnthis.expr;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.