@Test public void testRestoreState() { FacesContext context = EasyMock.createMock(FacesContext.class); UIInput input = new UIInput(); replay(context); input.restoreState(context, null); verify(context); }
@Override public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state == null) { return; } Object[] values = (Object[]) state; super.restoreState(context, values[0]); if (values[1] != null) { if (validators == null) { validators = new AttachedObjectListHolder<>(); } validators.restoreState(context, values[1]); } }
UIInput extends UIOutput implements EditableValueHolder { @Override public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state == null) { return; } Object[] values = (Object[]) state; super.restoreState(context, values[0]); if (values[1] != null) { if (validators == null) { validators = new AttachedObjectListHolder<>(); } validators.restoreState(context, values[1]); } } }
UIInput extends UIOutput implements EditableValueHolder { @Override public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state == null) { return; } Object[] values = (Object[]) state; super.restoreState(context, values[0]); if (values[1] != null) { if (validators == null) { validators = new AttachedObjectListHolder<>(); } validators.restoreState(context, values[1]); } } UIInput(); }
UIInput extends UIOutput implements EditableValueHolder { @Override public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state == null) { return; } Object[] values = (Object[]) state; super.restoreState(context, values[0]); if (values[1] != null) { if (validators == null) { validators = new AttachedObjectListHolder<>(); } validators.restoreState(context, values[1]); } } UIInput(); @Override String getFamily(); @Override Object getSubmittedValue(); @Override void setSubmittedValue(Object submittedValue); @Override Object getValue(); @Override void setValue(Object value); @Override void resetValue(); @Override boolean isLocalValueSet(); @Override void setLocalValueSet(boolean localValueSet); @Override boolean isRequired(); String getRequiredMessage(); void setRequiredMessage(String message); String getConverterMessage(); void setConverterMessage(String message); String getValidatorMessage(); void setValidatorMessage(String message); @Override boolean isValid(); @Override void setValid(boolean valid); @Override void setRequired(boolean required); @Override boolean isImmediate(); @Override void setImmediate(boolean immediate); @Override MethodBinding getValidator(); @Override void setValidator(MethodBinding validatorBinding); @Override MethodBinding getValueChangeListener(); @Override void setValueChangeListener(MethodBinding valueChangeListener); @Override void markInitialState(); @Override void clearInitialState(); @Override void processDecodes(FacesContext context); @Override void processValidators(FacesContext context); @Override void processUpdates(FacesContext context); @Override void decode(FacesContext context); void updateModel(FacesContext context); void validate(FacesContext context); static boolean isEmpty(Object value); @Override void addValidator(Validator validator); @Override Validator[] getValidators(); @Override void removeValidator(Validator validator); @Override void addValueChangeListener(ValueChangeListener listener); @Override ValueChangeListener[] getValueChangeListeners(); @Override void removeValueChangeListener(ValueChangeListener listener); @Override Object saveState(FacesContext context); @Override void restoreState(FacesContext context, Object state); }
UIInput extends UIOutput implements EditableValueHolder { @Override public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state == null) { return; } Object[] values = (Object[]) state; super.restoreState(context, values[0]); if (values[1] != null) { if (validators == null) { validators = new AttachedObjectListHolder<>(); } validators.restoreState(context, values[1]); } } UIInput(); @Override String getFamily(); @Override Object getSubmittedValue(); @Override void setSubmittedValue(Object submittedValue); @Override Object getValue(); @Override void setValue(Object value); @Override void resetValue(); @Override boolean isLocalValueSet(); @Override void setLocalValueSet(boolean localValueSet); @Override boolean isRequired(); String getRequiredMessage(); void setRequiredMessage(String message); String getConverterMessage(); void setConverterMessage(String message); String getValidatorMessage(); void setValidatorMessage(String message); @Override boolean isValid(); @Override void setValid(boolean valid); @Override void setRequired(boolean required); @Override boolean isImmediate(); @Override void setImmediate(boolean immediate); @Override MethodBinding getValidator(); @Override void setValidator(MethodBinding validatorBinding); @Override MethodBinding getValueChangeListener(); @Override void setValueChangeListener(MethodBinding valueChangeListener); @Override void markInitialState(); @Override void clearInitialState(); @Override void processDecodes(FacesContext context); @Override void processValidators(FacesContext context); @Override void processUpdates(FacesContext context); @Override void decode(FacesContext context); void updateModel(FacesContext context); void validate(FacesContext context); static boolean isEmpty(Object value); @Override void addValidator(Validator validator); @Override Validator[] getValidators(); @Override void removeValidator(Validator validator); @Override void addValueChangeListener(ValueChangeListener listener); @Override ValueChangeListener[] getValueChangeListeners(); @Override void removeValueChangeListener(ValueChangeListener listener); @Override Object saveState(FacesContext context); @Override void restoreState(FacesContext context, Object state); static final String COMPONENT_TYPE; static final String COMPONENT_FAMILY; static final String CONVERSION_MESSAGE_ID; static final String REQUIRED_MESSAGE_ID; static final String UPDATE_MESSAGE_ID; static final String VALIDATE_EMPTY_FIELDS_PARAM_NAME; static final String EMPTY_STRING_AS_NULL_PARAM_NAME; static final String ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE; }