Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * $Id: EditableValueHolder.java,v 1.12 2005/12/05 16:42:42 edburns Exp $
   */
  
  /*
   * The contents of this file are subject to the terms
   * of the Common Development and Distribution License
   * (the License). You may not use this file except in
   * compliance with the License.
  * 
  * You can obtain a copy of the License at
  * https://javaserverfaces.dev.java.net/CDDL.html or
  * legal/CDDLv1.0.txt. 
  * See the License for the specific language governing
  * permission and limitations under the License.
  * 
  * When distributing Covered Code, include this CDDL
  * Header Notice in each file and include the License file
  * at legal/CDDLv1.0.txt.    
  * If applicable, add the following below the CDDL Header,
  * with the fields enclosed by brackets [] replaced by
  * your own identifying information:
  * "Portions Copyrighted [year] [name of copyright owner]"
  * 
  * [Name of File] [ver.__] [Date]
  * 
  * Copyright 2005 Sun Microsystems Inc. All Rights Reserved
  */
 
 package javax.faces.component;
 
 

EditableValueHolder is an extension of ValueHolder that describes additional features supported by editable components, including javax.faces.event.ValueChangeEvents and javax.faces.validator.Validators.

 
 
 public interface EditableValueHolder extends ValueHolder {

    

Return the submittedValue value of this component. This method should only be used by the encodeBegin() and/or encodeEnd() methods of this component, or its corresponding javax.faces.render.Renderer.

 
     public Object getSubmittedValue();

    

Set the submittedValue value of this component. This method should only be used by the decode() and validate() method of this component, or its corresponding javax.faces.render.Renderer.

Parameters:
submittedValue The new submitted value
 
     public void setSubmittedValue(Object submittedValue);

    
Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.
 
     public boolean isLocalValueSet();

    
Sets the "local value set" state for this component.
 
     public void setLocalValueSet(boolean localValueSet);



    

Return a flag indicating whether the local value of this component is valid (no conversion error has occurred).

 
     public boolean isValid();


    

Set a flag indicating whether the local value of this component is valid (no conversion error has occurred).

Parameters:
valid The new valid flag
 
     public void setValid(boolean valid);


    

Return the "required field" state for this component.

 
     public boolean isRequired();

    

Set the "required field" state for this component.

Parameters:
required The new "required field" state
    public void setRequired(boolean required);

    

Return the "immediate" state for this component.

    public boolean isImmediate();

    

Set the "immediate" state for this component. When set to true, the component's value will be converted and validated immediately in the Apply Request Values phase, and javax.faces.event.ValueChangeEvents will be delivered in that phase as well. The default value for this property must be false.

Parameters:
immediate The new "immediate" state
    public void setImmediate(boolean immediate);

    

If setValidator(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValidator(javax.faces.el.MethodBinding).

This method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Deprecated:
getValidators() should be used instead.
    public MethodBinding getValidator();

    

Wrap the argument validatorBinding in an implementation of javax.faces.validator.Validator and store it in the internal data structure that backs the getValidators() method, taking care to over-write any instance that was stored by a previous call to setValidator.

The argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept parameters of type javax.faces.context.FacesContext, UIComponent, and Object.

Deprecated:
Use addValidator(javax.faces.validator.Validator) instead, obtaining the argument javax.faces.validator.Validator by creating an instance of javax.faces.validator.MethodExpressionValidator.
Parameters:
validatorBinding The new MethodBinding instance
    public void setValidator(MethodBinding validatorBinding);

    

If setValueChangeListener(javax.faces.el.MethodBinding) was not previously called for this instance, this method must return null. If it was called, this method must return the exact MethodBinding instance that was passed to setValueChangeListener(javax.faces.el.MethodBinding).

Deprecated:
Use getValueChangeListeners() instead.
    public MethodBinding getValueChangeListener();

    

Wrap the argument valueChangeMethod in an implementation of javax.faces.event.ValueChangeListener and store it in the internal data structure that backs the getValueChangeListeners() method, taking care to over-write any instance that was stored by a previous call to setValueChangeListener.

This argument method will be called during the Process Validations or Apply Request Values phases (depending on the value of the immediate property).

Any method referenced by such an expression must be public, with a return type of void, and accept a parameter of type javax.faces.event.ValueChangeEvent.

Deprecated:
Use addValueChangeListener(javax.faces.event.ValueChangeListener) instead, obtaining the argument javax.faces.event.ValueChangeListener by creating an instance of javax.faces.event.MethodExpressionValueChangeListener.
Parameters:
valueChangeMethod The new method binding instance
    public void setValueChangeListener(MethodBinding valueChangeMethod);

    

Add a javax.faces.validator.Validator instance to the set associated with this component.

Parameters:
validator The javax.faces.validator.Validator to add
Throws:
java.lang.NullPointerException if validator is null
    public void addValidator(Validator validator);

    

Return the set of registered javax.faces.validator.Validators for this component instance. If there are no registered validators, a zero-length array is returned.

    public Validator[] getValidators();

    

Remove a javax.faces.validator.Validator instance from the set associated with this component, if it was previously associated. Otherwise, do nothing.

Parameters:
validator The javax.faces.validator.Validator to remove
    public void removeValidator(Validator validator);

    

Add a new javax.faces.event.ValueChangeListener to the set of listeners interested in being notified when javax.faces.event.ValueChangeEvents occur.

Parameters:
listener The javax.faces.event.ValueChangeListener to be added
Throws:
java.lang.NullPointerException if listener is null
    public void addValueChangeListener(ValueChangeListener listener);

    

Return the set of registered javax.faces.event.ValueChangeListeners for this component instance. If there are no registered listeners, a zero-length array is returned.

    public ValueChangeListener[] getValueChangeListeners();

    

Remove an existing javax.faces.event.ValueChangeListener (if any) from the set of listeners interested in being notified when javax.faces.event.ValueChangeEvents occur.

Parameters:
listener The javax.faces.event.ValueChangeListener to be removed
Throws:
java.lang.NullPointerException if listener is null
    public void removeValueChangeListener(ValueChangeListener listener);
New to GrepCode? Check out our FAQ X