javax.faces.component._ValueBindingToValueExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of myfaces-api Show documentation
Show all versions of myfaces-api Show documentation
The public API classes of the Apache MyFaces CORE JSF-2.2 project
/*
* 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 javax.faces.component;
import javax.el.ELContext;
import javax.el.ELException;
import javax.el.PropertyNotFoundException;
import javax.el.PropertyNotWritableException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.ValueBinding;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Wraps a ValueBinding inside a ValueExpression. Also allows access to the original ValueBinding object.
*
* Although ValueExpression implements Serializable, this class implements StateHolder instead.
*
* ATTENTION: If you make changes to this class, treat {@link _ValueBindingToValueExpression} accordingly.
*
* @author Stan Silvert
* @see javax.faces.component._ValueBindingToValueExpression
*/
@SuppressWarnings("deprecation")
class _ValueBindingToValueExpression extends ValueExpression implements StateHolder
{
private static final long serialVersionUID = 8071429285360496554L;
private static final Log logger = LogFactory.getLog(_ValueBindingToValueExpression.class);
private ValueBinding _valueBinding;
private boolean _transient;
/**
* No-arg constructor used during restoreState
*/
protected _ValueBindingToValueExpression()
{
}
private ValueBinding getNotNullValueBinding()
{
if (_valueBinding == null)
{
throw new IllegalStateException("value binding is null");
}
return _valueBinding;
}
/** Creates a new instance of ValueBindingToValueExpression */
public _ValueBindingToValueExpression(ValueBinding valueBinding)
{
if (valueBinding == null)
{
throw new IllegalArgumentException("value binding must not be null");
}
this._valueBinding = valueBinding;
}
public ValueBinding getValueBinding()
{
return _valueBinding;
}
@Override
public boolean isReadOnly(final ELContext context) throws NullPointerException, PropertyNotFoundException,
ELException
{
return invoke(new Invoker()
{
public Boolean invoke()
{
return getNotNullValueBinding().isReadOnly(getFacesContext(context));
}
});
}
@Override
public Object getValue(final ELContext context) throws NullPointerException, PropertyNotFoundException, ELException
{
return invoke(new Invoker
© 2015 - 2025 Weber Informatics LLC | Privacy Policy