jakarta.faces.component.ValueHolder Maven / Gradle / Ivy
Show all versions of jakarta.faces Show documentation
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package jakarta.faces.component;
import jakarta.el.ValueExpression;
import jakarta.faces.convert.Converter;
/**
*
* ValueHolder is an interface that may be implemented by any concrete
* {@link UIComponent} that wishes to support a local value, as well as access data in the model tier via a value
* expression, and support conversion between String and the model tier data's native data type.
*/
public interface ValueHolder {
// -------------------------------------------------------------- Properties
/**
*
* Return the local value of this {@link UIComponent} (if any), without evaluating any associated
* {@link ValueExpression}.
*
*
* @return the local value.
*/
Object getLocalValue();
/**
*
* Gets the value of this {@link UIComponent}. If validation failed, as indicated by
* {@link jakarta.faces.context.FacesContext#isValidationFailed} returning true
, always return the local
* value. Otherwise, first, consult the local value property of this component. If non-null
return it. If
* null
, see if we have a {@link ValueExpression} for the value
property. If so, return the
* result of evaluating the property, otherwise return null
.
*
*
* @return the value.
*/
Object getValue();
/**
*
* Set the value of this {@link UIComponent} (if any).
*
*
* @param value The new local value
*/
void setValue(Object value);
/**
*
* Return the {@link Converter} (if any) that is registered for this {@link UIComponent}.
*
*
* @return the converter.
*/
Converter getConverter();
/**
*
* Set the {@link Converter} (if any) that is registered for this {@link UIComponent}.
*
*
* @param converter New {@link Converter} (or null
)
*/
void setConverter(Converter converter);
}