Package javax.faces.validator

Examples of javax.faces.validator.MethodExpressionValidator


        {
            comp.setValueExpression("requiredMessage", _requiredMessage);
        }
        if (_validator != null)
        {
            comp.addValidator(new MethodExpressionValidator(_validator));
        }
        if (_validatorMessage != null)
        {
            comp.setValueExpression("validatorMessage", _validatorMessage);
        }
View Full Code Here


            MethodExpression methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                    createMethodExpression(elContext,
                            attributeExpressionString, Void.TYPE,
                            VALIDATOR_SIGNATURE), attributeNameValueExpression);

            validator = new MethodExpressionValidator(methodExpression);
        }
        ((EditableValueHolder) innerComponent).addValidator(validator);
        mctx.addMethodExpressionTargeted(innerComponent, targetAttributeName, validator);
    }
View Full Code Here

                                                               ve.getExpressionString(),
                                                               Void.TYPE,
                                                               VALIDATOR_ARGS);

                ((EditableValueHolder) target).addValidator(
                      new MethodExpressionValidator(
                            new ContextualCompositeMethodExpression(ve,
                                                                    me)));

            }
View Full Code Here

                                                               ve.getExpressionString(),
                                                               Void.TYPE,
                                                               VALIDATOR_ARGS);

                ((EditableValueHolder) target).addValidator(
                      new MethodExpressionValidator(
                            new ContextualCompositeMethodExpression(ve,
                                                                    me)));

            }
View Full Code Here

            LOG.error("Component is not instanceof SupportsMarkup. Instance is: " + parent.getClass().getName());
          }
        } else if (parent instanceof EditableValueHolder && Attributes.VALIDATOR.equals(nameValue)) {
          MethodExpression methodExpression = getMethodExpression(faceletContext, null, ComponentUtils.VALIDATOR_ARGS);
          if (methodExpression != null) {
            ((EditableValueHolder) parent).addValidator(new MethodExpressionValidator(methodExpression));
          }
        } else if (parent instanceof EditableValueHolder
            && Attributes.VALUE_CHANGE_LISTENER.equals(nameValue)) {
          MethodExpression methodExpression =
              getMethodExpression(faceletContext, null, ComponentUtils.VALUE_CHANGE_LISTENER_ARGS);
View Full Code Here

    return expressionFactory.createValueExpression(facesContext.getELContext(), string, Object.class);
  }

  public static void setValidator(EditableValueHolder editableValueHolder, Object validator) {
    if (validator instanceof MethodExpression) {
      editableValueHolder.addValidator(new MethodExpressionValidator((MethodExpression) validator));
    } else {
      LOG.error("Unknown instance for validator: " + (validator != null ? validator.getClass().getName() : validator));
    }
  }
View Full Code Here

                                        {
                                            validator = new PartialMethodExpressionValidator(methodExpression);
                                        }
                                        else
                                        {
                                            validator = new MethodExpressionValidator(methodExpression);
                                        }
                                    }
                                    ((EditableValueHolder) innerComponent).addValidator(validator);
                                    mctx.addMethodExpressionTargeted(innerComponent, attributeName, validator);
                                    if (mctx.isUsingPSSOnThisView() && mctx.isMarkInitialState())
View Full Code Here

                                                               ve.getExpressionString(),
                                                               Void.TYPE,
                                                               VALIDATOR_ARGS);

                ((EditableValueHolder) target).addValidator(
                      new MethodExpressionValidator(
                            new ContextualCompositeMethodExpression(ve,
                                                                    me)));

            }
View Full Code Here

            this.attr = attr;
        }

        public void applyMetadata(FaceletContext ctx, Object instance) {
            ((EditableValueHolder) instance)
                    .addValidator(new MethodExpressionValidator(this.attr
                            .getMethodExpression(ctx, null, VALIDATOR_SIG)));
        }
View Full Code Here

                                    methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                                            createMethodExpression(elContext,
                                                attributeExpressionString, Void.TYPE,
                                                VALIDATOR_SIGNATURE), attributeNameValueExpression);
       
                                    Validator validator = new MethodExpressionValidator(methodExpression);
                                    ((EditableValueHolder)innerComponent).addValidator( validator );
                                    mctx.addMethodExpressionTargeted(innerComponent, attributeName, validator);
                                }
                                else if ("valueChangeListener".equals(attributeName))
                                {
View Full Code Here

TOP

Related Classes of javax.faces.validator.MethodExpressionValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.