Top Inners Fields Constructors Methods
com.sun.faces.ext.component

public Class UIValidateWholeBean

extends UIInput
implements PartialStateHolder
Class Inheritance
All Implemented Interfaces
javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder
Static Imports
com.sun.faces.util.Util.reverse, java.lang.Boolean.TRUE, javax.faces.validator.BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN, .BeanValidator.ENABLE_VALIDATE_WHOLE_BEAN_PARAM_NAME, .BeanValidator.VALIDATION_GROUPS_DELIMITER

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static enum

Field Summary

Modifier and TypeField and Description
private transient Class<?>[]
private static final String
private static final String
public static final String
private boolean
private boolean
private transient String
Inherited from javax.faces.component.UIInput:
ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUECOMPONENT_FAMILYCOMPONENT_TYPECONVERSION_MESSAGE_IDEMPTY_STRING_AS_NULL_PARAM_NAMEREQUIRED_MESSAGE_IDUPDATE_MESSAGE_IDVALIDATE_EMPTY_FIELDS_PARAM_NAME

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
addValidator(Validator<T>
The Validator to add
validator
)

Overrides javax.faces.component.UIInput.addValidator.

Implements javax.faces.component.EditableValueHolder.addValidator.

Add a Validator instance to the set associated with this UIInput.

private Class<?>
classForName(String className)

public void
clearInitialState()

Overrides javax.faces.component.UIInput.clearInitialState.

Implements javax.faces.component.PartialStateHolder.clearInitialState.

Reset the PartialStateHolder to a non-delta tracking state.

public void
encodeBegin(FacesContext
FacesContext for the response we are creating
context
)

Overrides javax.faces.component.UIComponentBase.encodeBegin.

If our rendered property is true, render the beginning of the current state of this UIComponent to the response contained in the specified FacesContext.

public static <C extends UIComponent> C
getClosestParent(UIComponent component, Class<C> parentType)

public String
getFamily()

Overrides javax.faces.component.UIInput.getFamily.

Return the identifier of the component family to which this component belongs.

public Object
public String
pack-priv Class<?>[]
public boolean
initialStateMarked()

Overrides javax.faces.component.UIComponent.initialStateMarked.

Implements javax.faces.component.PartialStateHolder.initialStateMarked.

Return true if delta state changes are being tracked, otherwise false

public boolean
isTransient()

Overrides javax.faces.component.UIComponentBase.isTransient.

Implements javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

private boolean
public void
markInitialState()

Overrides javax.faces.component.UIInput.markInitialState.

Implements javax.faces.component.PartialStateHolder.markInitialState.

The runtime must ensure that the markInitialState method is called on each instance of this interface in the view at the appropriate time to indicate the component is in its initial state.

private static void
misplacedComponentCheck(UIComponent parentComponent, String clientId)

public void
restoreState(FacesContext
the Faces context.
context
,
Object
the state.
state
)

Overrides javax.faces.component.UIInput.restoreState.

Implements javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

public Object
saveState(FacesContext
the Faces context.
context
)

Overrides javax.faces.component.UIInput.saveState.

Implements javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

public void
setConverter(Converter<T>
New Converter (or null)
converter
)

Overrides javax.faces.component.UIOutput.setConverter.

Implements javax.faces.component.ValueHolder.setConverter.

Set the Converter (if any) that is registered for this UIComponent.

public void
setTransient(boolean
boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.
transientValue
)

Overrides javax.faces.component.UIComponentBase.setTransient.

Implements javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

public void
setValidationGroups(String validationGroups)

private void
setValidatorInstalled(boolean newValue)

public void
validate(FacesContext
The FacesContext for the current request
context
)

Overrides javax.faces.component.UIInput.validate.

Perform the following algorithm to validate the local value of this UIInput.

private boolean
Inherited from javax.faces.component.UIInput:
addValueChangeListenercompareValuesdecodegetConvertedValuegetConverterMessagegetRequiredMessagegetValidatorgetValidatorMessagegetValidatorsgetValuegetValueChangeListenergetValueChangeListenersisEmptyisImmediateisLocalValueSetisRequiredisValidprocessDecodesprocessUpdatesprocessValidatorsremoveValidatorremoveValueChangeListenerresetValuesetConverterMessagesetImmediatesetLocalValueSetsetRequiredsetRequiredMessagesetSubmittedValuesetValidsetValidatorsetValidatorMessagesetValuesetValueChangeListenerupdateModelvalidateValue

Field Detail

cachedValidationGroupsback to summary
private transient Class<?>[] cachedValidationGroups
ERROR_MISPLACED_COMPONENTback to summary
private static final String ERROR_MISPLACED_COMPONENT
ERROR_MISSING_FORMback to summary
private static final String ERROR_MISSING_FORM
FAMILYback to summary
public static final String FAMILY
initialStateback to summary
private boolean initialState

Hides javax.faces.component.UIComponent.initialState.

transientValueback to summary
private boolean transientValue
validationGroupsback to summary
private transient String validationGroups

Constructor Detail

UIValidateWholeBeanback to summary
public UIValidateWholeBean()

Method Detail

addValidatorback to summary
public final void addValidator(Validator<T> validator)

Overrides javax.faces.component.UIInput.addValidator.

Implements javax.faces.component.EditableValueHolder.addValidator.

Doc from javax.faces.component.UIInput.addValidator.

Add a Validator instance to the set associated with this UIInput.

Parameters
validator:Validator<T>

The Validator to add

Annotations
@Override
classForNameback to summary
private Class<?> classForName(String className)
clearInitialStateback to summary
public void clearInitialState()

Overrides javax.faces.component.UIInput.clearInitialState.

Implements javax.faces.component.PartialStateHolder.clearInitialState.

Doc from javax.faces.component.PartialStateHolder.clearInitialState.

Reset the PartialStateHolder to a non-delta tracking state.

Annotations
@Override
encodeBeginback to summary
public void encodeBegin(FacesContext context) throws IOException

Overrides javax.faces.component.UIComponentBase.encodeBegin.

Doc from javax.faces.component.UIComponent.encodeBegin.

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 pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent). Call javax.faces.application.Application#publishEvent, passing javax.faces.event.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 pushComponentToEL(javax.faces.context.FacesContext, javax.faces.component.UIComponent) and return immediately.

Parameters
context:FacesContext

FacesContext for the response we are creating

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
getClosestParentback to summary
public static <C extends UIComponent> C getClosestParent(UIComponent component, Class<C> parentType)
getFamilyback to summary
public String getFamily()

Overrides javax.faces.component.UIInput.getFamily.

Doc from javax.faces.component.UIComponent.getFamily.

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

Returns:String

the component family (not null).

Annotations
@Override
getSubmittedValueback to summary
public Object getSubmittedValue()

Overrides javax.faces.component.UIInput.getSubmittedValue.

Implements javax.faces.component.EditableValueHolder.getSubmittedValue.

Doc from javax.faces.component.UIInput.getSubmittedValue.

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.

Returns:Object

Doc from javax.faces.component.EditableValueHolder.getSubmittedValue.

the submitted value.

Annotations
@Override
getValidationGroupsback to summary
public String getValidationGroups()
getValidationGroupsArrayback to summary
pack-priv Class<?>[] getValidationGroupsArray()
initialStateMarkedback to summary
public boolean initialStateMarked()

Overrides javax.faces.component.UIComponent.initialStateMarked.

Implements javax.faces.component.PartialStateHolder.initialStateMarked.

Doc from javax.faces.component.PartialStateHolder.initialStateMarked.

Return true if delta state changes are being tracked, otherwise false

Returns:boolean

true if the initial state is marked, false otherwise.

Annotations
@Override
isTransientback to summary
public boolean isTransient()

Overrides javax.faces.component.UIComponentBase.isTransient.

Implements javax.faces.component.StateHolder.isTransient.

Doc from javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

Returns:boolean

true if transient, false otherwise.

Annotations
@Override
isValidatorInstalledback to summary
private boolean isValidatorInstalled()
markInitialStateback to summary
public void markInitialState()

Overrides javax.faces.component.UIInput.markInitialState.

Implements javax.faces.component.PartialStateHolder.markInitialState.

Doc from javax.faces.component.PartialStateHolder.markInitialState.

The runtime must ensure that the markInitialState method is called on each instance of this interface in the view at the appropriate time to indicate the component is in its initial state. The implementor of the interface must ensure that initialStateMarked returns true from the time markInitialState() is called until clearInitialState is called, after which time initialStateMarked() must return false. Also, during the time that the instance returns true from initialStateMarked(), the implementation must return only the state that has changed in its implementation of StateHolder#saveState.

Annotations
@Override
misplacedComponentCheckback to summary
private static void misplacedComponentCheck(UIComponent parentComponent, String clientId) throws IllegalArgumentException
restoreStateback to summary
public void restoreState(FacesContext context, Object state)

Overrides javax.faces.component.UIInput.restoreState.

Implements javax.faces.component.StateHolder.restoreState.

Doc from javax.faces.component.StateHolder.restoreState.

Perform 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 restoreState method on all those instances as well.

If the state argument is null, take no action and return.

Parameters
context:FacesContext

the Faces context.

state:Object

the state.

Annotations
@Override
saveStateback to summary
public Object saveState(FacesContext context)

Overrides javax.faces.component.UIInput.saveState.

Implements javax.faces.component.StateHolder.saveState.

Doc from javax.faces.component.StateHolder.saveState.

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 saveState method on all those instances as well. This method must not save the state of children and facets. That is done via the javax.faces.application.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

Parameters
context:FacesContext

the Faces context.

Returns:Object

the saved state.

Annotations
@Override
setConverterback to summary
public void setConverter(Converter<T> converter)

Overrides javax.faces.component.UIOutput.setConverter.

Implements javax.faces.component.ValueHolder.setConverter.

Doc from javax.faces.component.ValueHolder.setConverter.

Set the Converter (if any) that is registered for this UIComponent.

Parameters
converter:Converter<T>

New Converter (or null)

Annotations
@Override
setTransientback to summary
public void setTransient(boolean transientValue)

Overrides javax.faces.component.UIComponentBase.setTransient.

Implements javax.faces.component.StateHolder.setTransient.

Doc from javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters
transientValue:boolean

boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.

Annotations
@Override
setValidationGroupsback to summary
public void setValidationGroups(String validationGroups)
setValidatorInstalledback to summary
private void setValidatorInstalled(boolean newValue)
validateback to summary
public void validate(FacesContext context)

Overrides javax.faces.component.UIInput.validate.

Doc from javax.faces.component.UIInput.validate.

Perform the following algorithm to validate the local value of this UIInput.

  • Retrieve the submitted value with getSubmittedValue. If this returns null, and the value of the 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.)
  • If the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context parameter value is true (ignoring case), and getSubmittedValue() returns a zero-length String call setSubmittedValue, passing null as the argument and continue processing using null as the current submitted value.
  • Convert the submitted value into a "local value" of the appropriate data type by calling getConvertedValue.
  • If conversion fails:
    • Enqueue an appropriate error message by calling the addMessage() method on the FacesContext.
    • Set the valid property on this component to false
  • Validate the property by calling validateValue.
  • If the 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 setSubmittedValue passing null as the argument. If the local value is different from the previous value of this component, as determined by a call to compareValues, 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.

Parameters
context:FacesContext

The FacesContext for the current request

Annotations
@Override
wholeBeanValidationEnabledback to summary
private boolean wholeBeanValidationEnabled(FacesContext context)
com.sun.faces.ext.component back to summary

private Class UIValidateWholeBean.BreakException

extends RuntimeException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

BreakExceptionback to summary
private BreakException()
com.sun.faces.ext.component back to summary

private final Enum UIValidateWholeBean.PropertyKeys

extends Enum<UIValidateWholeBean.PropertyKeys>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final UIValidateWholeBean.PropertyKeys

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UIValidateWholeBean.PropertyKeys
public static UIValidateWholeBean.PropertyKeys[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ValidatorInstalledback to summary
public static final UIValidateWholeBean.PropertyKeys ValidatorInstalled

Constructor Detail

PropertyKeysback to summary
private PropertyKeys()

Method Detail

valueOfback to summary
public static UIValidateWholeBean.PropertyKeys valueOf(String name)
valuesback to summary
public static UIValidateWholeBean.PropertyKeys[] values()