public class UIValidateWholeBean
extends javax.faces.component.UIInput
implements javax.faces.component.PartialStateHolder
| Modifier and Type | Field and Description |
|---|---|
static String |
FAMILY |
| Constructor and Description |
|---|
UIValidateWholeBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
addValidator(javax.faces.validator.Validator validator)
Add a
Validator instance to the set associated with
this UIInput. |
void |
clearInitialState()
For each of the attached objects on this instance that implement |
void |
encodeBegin(javax.faces.context.FacesContext context)
If our
rendered property is
true, render the beginning of the current state of this
UIComponent to the response contained in the specified
FacesContext. |
static <C extends javax.faces.component.UIComponent> |
getClosestParent(javax.faces.component.UIComponent component,
Class<C> parentType) |
String |
getFamily()
Return the identifier of the component family to which this component belongs. |
Object |
getSubmittedValue()
Return the submittedValue value of this
UIInput component. |
String |
getValidationGroups() |
boolean |
initialStateMarked()
An implementation of |
boolean |
isTransient()
If true, the Object implementing this interface must not
participate in state saving or restoring.
|
void |
markInitialState()
In addition to the actions taken in
UIOutput
when PartialStateHolder.markInitialState() is called,
check if any of the installed Validators are PartialStateHolders and
if so, call PartialStateHolder.markInitialState()
as appropriate. |
void |
restoreState(javax.faces.context.FacesContext context,
Object state)
Perform any
processing required to restore the state from the entries in the
state Object.
|
Object |
saveState(javax.faces.context.FacesContext context)
Gets the state of the instance as a
Serializable Object. |
void |
setConverter(javax.faces.convert.Converter converter)
Set the
Converter (if any) that is registered for this
UIComponent. |
void |
setTransient(boolean transientValue)
Denotes
whether or not the Object implementing this interface must or
must not participate in state saving or restoring.
|
void |
setValidationGroups(String validationGroups) |
void |
updateModel(javax.faces.context.FacesContext context)
Perform
the following algorithm to update the model data
associated with this
UIInput, if any, as appropriate. |
void |
validate(javax.faces.context.FacesContext context)
Perform the following algorithm to
validate the local value of this
UIInput. |
addValueChangeListener, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getValidator, getValidatorMessage, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, validateValueaddClientBehavior, addFacesListener, broadcast, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setValueBinding, subscribeToEvent, unsubscribeFromEventencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTreepublic static final String FAMILY
public String getFamily()
javax.faces.component.UIComponent
Return the identifier of the component family to which this component belongs. This
identifier, in conjunction with the value of the rendererType
property, may be used to select the appropriate Renderer for this component
instance. Note this method should NOT return null
getFamily in class javax.faces.component.UIInputpublic Object getSubmittedValue()
javax.faces.component.UIInputReturn the submittedValue value of this UIInput component.
This method should only be used by the decode() and
validate() method of this component, or
its corresponding Renderer.
getSubmittedValue in interface javax.faces.component.EditableValueHoldergetSubmittedValue in class javax.faces.component.UIInputpublic void setConverter(javax.faces.convert.Converter converter)
javax.faces.component.ValueHolderSet the Converter (if any) that is registered for this
UIComponent.
setConverter in interface javax.faces.component.ValueHoldersetConverter in class javax.faces.component.UIOutputconverter - New Converter (or null)public final void addValidator(javax.faces.validator.Validator validator)
javax.faces.component.UIInputAdd a Validator instance to the set associated with
this UIInput.
addValidator in interface javax.faces.component.EditableValueHolderaddValidator in class javax.faces.component.UIInputvalidator - The Validator to addpublic void setValidationGroups(String validationGroups)
public String getValidationGroups()
public void validate(javax.faces.context.FacesContext context)
javax.faces.component.UIInputPerform the following algorithm to
validate the local value of this UIInput.
UIInput.getSubmittedValue().
If this returns null, and
the value of the UIInput.ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE
context-param is true (ignoring case), examine the value of the "required"
property. If the value of "required" is true, continue as below. If
the value of "required" is false or the required attribute is not set,
exit without further processing. If the context-param is not set, or is
set to false (ignoring case), exit without further processing.
(This indicates that no value was submitted for this
component.)javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
context parameter value is true (ignoring case), and
getSubmittedValue() returns a zero-length
String call UIInput.setSubmittedValue(java.lang.Object),
passing null as the argument and continue processing
using null as the current submitted
value.UIInput.getConvertedValue(javax.faces.context.FacesContext, java.lang.Object).addMessage() method on the
FacesContext.valid property
on this component to false UIInput.validateValue(javax.faces.context.FacesContext, java.lang.Object).valid property of this component is still
true, retrieve the previous value of the component
(with getValue()), store the new local value using
setValue(), and reset the submitted value to null
with a call to UIInput.setSubmittedValue(java.lang.Object)
passing null as the argument.
If the local value is different from the previous value of this
component, as determined by a
call to UIInput.compareValues(java.lang.Object, java.lang.Object), fire a ValueChangeEvent to be broadcast to all interested
listeners.Application components implementing UIInput that wish to
perform validation with logic embedded in the component should perform
their own correctness checks, and then call the
super.validate() method to perform the standard
processing described above.
validate in class javax.faces.component.UIInputcontext - The FacesContext for the current requestpublic void updateModel(javax.faces.context.FacesContext context)
javax.faces.component.UIInputPerform
the following algorithm to update the model data
associated with this UIInput, if any, as appropriate.
valid property of this component is
false, take no further action.localValueSet property of this component is
false, take no further action.ValueExpression for value exists,
take no further action.setValue() method of the ValueExpression
to update the value that the ValueExpression points at.setValue() method returns successfully:
UIInput.localValueSet property of this
UIInput to false.setValue() method throws an Exception:
FacesMessage with the id UIInput.UPDATE_MESSAGE_ID. Create a
UpdateModelException, passing the FacesMessage and
the caught exception to the constructor. Create an
ExceptionQueuedEventContext, passing the FacesContext,
the UpdateModelException, this component instance, and
PhaseId.UPDATE_MODEL_VALUES to its constructor. Call
FacesContext.getExceptionHandler() and then call
ExceptionHandler.processEvent(javax.faces.event.SystemEvent), passing the
ExceptionQueuedEventContext.
valid property of this UIInput
to false.updateModel in class javax.faces.component.UIInputcontext - FacesContext for the request we are processingpublic void encodeBegin(javax.faces.context.FacesContext context)
throws IOException
javax.faces.component.UIComponent
If our rendered property is
true, render the beginning of the current state of this
UIComponent to the response contained in the specified
FacesContext. Call
UIComponent.pushComponentToEL(javax.faces.context.FacesContext,javax.faces.component.UIComponent).
Call Application.publishEvent(javax.faces.context.FacesContext, java.lang.Class<? extends javax.faces.event.SystemEvent>, java.lang.Object), passing
PreRenderComponentEvent.class as the first
argument and the component instance to be rendered as the second argument.
If a Renderer is associated with this UIComponent, the actual
encoding will be delegated to
Renderer.encodeBegin(FacesContext, UIComponent).
If our rendered property is false, call
UIComponent.pushComponentToEL(javax.faces.context.FacesContext,javax.faces.component.UIComponent)
and return immediately.
encodeBegin in class javax.faces.component.UIComponentBasecontext - FacesContext for the response we are creatingIOException - if an input/output error occurs while renderingpublic static <C extends javax.faces.component.UIComponent> C getClosestParent(javax.faces.component.UIComponent component,
Class<C> parentType)
public void markInitialState()
javax.faces.component.UIInput
In addition to the actions taken in UIOutput
when PartialStateHolder.markInitialState() is called,
check if any of the installed Validators are PartialStateHolders and
if so, call PartialStateHolder.markInitialState()
as appropriate.
markInitialState in interface javax.faces.component.PartialStateHoldermarkInitialState in class javax.faces.component.UIInputpublic boolean initialStateMarked()
javax.faces.component.UIComponent
An implementation of PartialStateHolder.initialStateMarked(), this method is
called by the runtime to test if the PartialStateHolder.markInitialState()
method was called.
initialStateMarked in interface javax.faces.component.PartialStateHolderinitialStateMarked in class javax.faces.component.UIComponenttrue if the initial state is marked, false otherwise.public void clearInitialState()
javax.faces.component.UIComponentBase
For each of the attached objects on this instance that implement PartialStateHolder,
call PartialStateHolder.clearInitialState() on the attached object.
clearInitialState in interface javax.faces.component.PartialStateHolderclearInitialState in class javax.faces.component.UIInputpublic boolean isTransient()
javax.faces.component.StateHolderIf true, the Object implementing this interface must not participate in state saving or restoring.
isTransient in interface javax.faces.component.StateHolderisTransient in class javax.faces.component.UIComponentBasetrue if transient, false otherwise.public void setTransient(boolean transientValue)
javax.faces.component.StateHolderDenotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
setTransient in interface javax.faces.component.StateHoldersetTransient in class javax.faces.component.UIComponentBasetransientValue - boolean pass true if this
Object will not
participate in state saving or restoring, otherwise pass
false.public Object saveState(javax.faces.context.FacesContext context)
javax.faces.component.StateHolder Gets the state of the instance as a
Serializable Object.
If the class that implements this interface has references to
instances that implement StateHolder (such as a
UIComponent with event handlers, validators, etc.)
this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those
instances as well. This method must not save the state
of children and facets. That is done via the StateManager
This method must not alter the state of the implementing object. In other words, after executing this code:
Object state = component.saveState(facesContext);
component should be the same as before executing
it.
The return from this method must be Serializable
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIInputcontext - the Faces context.public void restoreState(javax.faces.context.FacesContext context,
Object state)
javax.faces.component.StateHolderPerform any processing required to restore the state from the entries in the state Object.
If the class that implements this interface has references to
instances that also implement StateHolder (such as a
UIComponent with event handlers, validators, etc.)
this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those
instances as well.
If the state
argument is null, take no action and return.
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIInputcontext - the Faces context.state - the state.Copyright © 2010–2019 JBoss by Red Hat. All rights reserved.