private static void removeCollectingValidator(UIInput input) { Validator<?> collectingValidator = null; for (Validator<?> validator : input.getValidators()) { if (validator instanceof CollectingValidator) { collectingValidator = validator; break; } } if (collectingValidator != null) { input.removeValidator(collectingValidator); } }
private static void removeCollectingValidator(UIInput input) { Validator<?> collectingValidator = null; for (Validator<?> validator : input.getValidators()) { if (validator instanceof CollectingValidator) { collectingValidator = validator; break; } } if (collectingValidator != null) { input.removeValidator(collectingValidator); } }
@Override public Validator[] getValidators() { return getWrapped().getValidators(); }
@Override public Validator[] getValidators() { return getWrapped().getValidators(); }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ @Override public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ @Override public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ @Override public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ @Override public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
/** * <p>Return a <code>MethodBinding</code> pointing at a * method that will be called during <em>Process Validations</em> * phase of the request processing lifecycle, to validate the current * value of this component.</p> * * @deprecated {@link #getValidators} should be used instead. */ @Override public MethodBinding getValidator() { MethodBinding result = null; Validator[] curValidators = getValidators(); // go through our lisetners list and find the one and only // MethodBindingValidator instance, if present. if (null != curValidators) { for (int i = 0; i < curValidators.length; i++) { // We are guaranteed to have at most one instance of // MethodBindingValidator in the curValidators list. if (MethodBindingValidator.class == curValidators[i].getClass()) { result = ((MethodBindingValidator) curValidators[i]). getWrapped(); break; } } } return result; }
public Validator[] getValidators() { setupPerspective(); Validator[] retValue = innerGetDelegateInput().getValidators(); teardownPerspective(); return retValue; }
Validator<?>[] validators = input.getValidators(); allValidators.put(clientId, validators);
Validator[] curValidators = getValidators();
Validator[] curValidators = getValidators();
Validator<?>[] validators = input.getValidators(); allValidators.put(clientId, validators);
private static void validateEmptyString(FacesContext context, UIComponent component, String string) { UIInput input = (UIInput) component; if (input.isValid() && string != null && string.length() == 0) { if (input.getValidators() != null) { for (Validator validator : input.getValidators()) { try { validator.validate(context, input, string); } catch (ValidatorException ve) { // If the validator throws an exception, we're // invalid, and we need to add a message input.setValid(false); FacesMessage message; String validatorMessageString = input.getValidatorMessage(); if (null != validatorMessageString) { message = new FacesMessage(FacesMessage.SEVERITY_ERROR, validatorMessageString, validatorMessageString); message.setSeverity(FacesMessage.SEVERITY_ERROR); } else { message = ve.getFacesMessage(); } if (message != null) { context.addMessage(input.getClientId(context), message); } } } } } } }
public static CVCall createCVCall(UIInput input) { CVCall call = new CVCall(); call.setId( input.getId() ); call.setClientId( input.getClientId( FacesContext.getCurrentInstance() ) ); call.setRequired( input.isRequired() ); //converter Converter converter = RendererUtils.findUIOutputConverter( FacesContext.getCurrentInstance(), input ); if( converter instanceof ClientConverter ) { call.setConverterScriptFunction( ( (ClientConverter) converter ).getScriptFunction() ); call.setConverterScriptResource( ( (ClientConverter) converter ).getScriptResource() ); } //validators int numberOfValidators = input.getValidators().length; call.setValidatorScriptFunctions( ( new String[numberOfValidators] ) ); call.setValidatorScriptResources( ( new String[numberOfValidators] ) ); for( int i = 0; i < numberOfValidators; i++ ) { Validator validator = input.getValidators()[i]; if( validator instanceof ClientValidator ) { call.getValidatorScriptFunctions()[i] = ((ClientValidator) validator).getScriptFunction(); call.getValidatorScriptResources()[i] = ((ClientValidator) validator).getScriptResource(); } } return call; }
public static void callValidators(FacesContext context, UIInput input, Object convertedValue) { Validator[] validators = input.getValidators(); for (int i = 0; i < validators.length; ++i) { Validator validator = validators[i];