public class UIValidateWholeBean
extends jakarta.faces.component.UIInput
implements jakarta.faces.component.PartialStateHolder
| Modifier and Type | Field and Description |
|---|---|
static String |
FAMILY |
ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE, COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, EMPTY_STRING_AS_NULL_PARAM_NAME, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID, VALIDATE_EMPTY_FIELDS_PARAM_NAMEATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY| Constructor and Description |
|---|
UIValidateWholeBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
addValidator(jakarta.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(jakarta.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 jakarta.faces.component.UIComponent> |
getClosestParent(jakarta.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(jakarta.faces.context.FacesContext context,
Object state)
Perform any processing required to restore the state from the entries
in the state Object.
|
Object |
saveState(jakarta.faces.context.FacesContext context)
Gets the state of the instance as a
Serializable Object. |
void |
setConverter(jakarta.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(jakarta.faces.context.FacesContext context)
Perform the following algorithm to update the model data associated with
this
UIInput, if any, as appropriate. |
void |
validate(jakarta.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()
jakarta.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 jakarta.faces.component.UIInputpublic Object getSubmittedValue()
jakarta.faces.component.UIInput
Return 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 jakarta.faces.component.EditableValueHoldergetSubmittedValue in class jakarta.faces.component.UIInputpublic void setConverter(jakarta.faces.convert.Converter converter)
jakarta.faces.component.ValueHolder
Set the Converter (if any) that is registered for this UIComponent.
setConverter in interface jakarta.faces.component.ValueHoldersetConverter in class jakarta.faces.component.UIOutputconverter - New Converter (or null)public final void addValidator(jakarta.faces.validator.Validator validator)
jakarta.faces.component.UIInput
Add a Validator instance to the set associated with this UIInput.
addValidator in interface jakarta.faces.component.EditableValueHolderaddValidator in class jakarta.faces.component.UIInputvalidator - The Validator to addpublic void setValidationGroups(String validationGroups)
public String getValidationGroups()
public void validate(jakarta.faces.context.FacesContext context)
jakarta.faces.component.UIInput
Perform 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.)jakarta.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(jakarta.faces.context.FacesContext, java.lang.Object).addMessage() method on the
FacesContext.valid property on this component to falseUIInput.validateValue(jakarta.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 jakarta.faces.component.UIInputcontext - The FacesContext for the current requestpublic void updateModel(jakarta.faces.context.FacesContext context)
jakarta.faces.component.UIInput
Perform 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(jakarta.faces.event.SystemEvent), passing the ExceptionQueuedEventContext.valid property of this UIInput to false.updateModel in class jakarta.faces.component.UIInputcontext - FacesContext for the request we are processingpublic void encodeBegin(jakarta.faces.context.FacesContext context)
throws IOException
jakarta.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(jakarta.faces.context.FacesContext,jakarta.faces.component.UIComponent). Call
Application.publishEvent(jakarta.faces.context.FacesContext, java.lang.Class<? extends jakarta.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(jakarta.faces.context.FacesContext,jakarta.faces.component.UIComponent) and return
immediately.
encodeBegin in class jakarta.faces.component.UIComponentBasecontext - FacesContext for the response we are creatingIOException - if an input/output error occurs while renderingpublic static <C extends jakarta.faces.component.UIComponent> C getClosestParent(jakarta.faces.component.UIComponent component,
Class<C> parentType)
public void markInitialState()
jakarta.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 jakarta.faces.component.PartialStateHoldermarkInitialState in class jakarta.faces.component.UIInputpublic boolean initialStateMarked()
jakarta.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 jakarta.faces.component.PartialStateHolderinitialStateMarked in class jakarta.faces.component.UIComponenttrue if the initial state is marked, false otherwise.public void clearInitialState()
jakarta.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 jakarta.faces.component.PartialStateHolderclearInitialState in class jakarta.faces.component.UIInputpublic boolean isTransient()
jakarta.faces.component.StateHolderIf true, the Object implementing this interface must not participate in state saving or restoring.
isTransient in interface jakarta.faces.component.StateHolderisTransient in class jakarta.faces.component.UIComponentBasetrue if transient, false otherwise.public void setTransient(boolean transientValue)
jakarta.faces.component.StateHolderDenotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
setTransient in interface jakarta.faces.component.StateHoldersetTransient in class jakarta.faces.component.UIComponentBasetransientValue - boolean pass true if this Object will
not participate in state saving or restoring, otherwise pass false.public Object saveState(jakarta.faces.context.FacesContext context)
jakarta.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(jakarta.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 jakarta.faces.component.StateHoldersaveState in class jakarta.faces.component.UIInputcontext - the Faces context.public void restoreState(jakarta.faces.context.FacesContext context,
Object state)
jakarta.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(jakarta.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 jakarta.faces.component.StateHolderrestoreState in class jakarta.faces.component.UIInputcontext - the Faces context.state - the state.Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.