Package org.jboss.seam.rest.validation

Examples of org.jboss.seam.rest.validation.ValidateRequest


        }

        Set<ConstraintViolation<Object>> violations = new HashSet<ConstraintViolation<Object>>();

        MethodMetadata method = metadata.getMethodMetadata(ctx.getMethod());
        ValidateRequest interceptorBinding = method.getInterceptorBinding();
        Class<?>[] groups = interceptorBinding.groups();

        // validate JAX-RS resource fields
        if (interceptorBinding.validateResourceFields()) {
            log.debugv("Validating JAX-RS resource {0}", ctx.getTarget());
            violations.addAll(validator.validate(ctx.getTarget(), groups));
        }

        // validate message body
        if (interceptorBinding.validateMessageBody() && (method.getMessageBody() != null)) {
            Object parameter = ctx.getParameters()[method.getMessageBody()];
            log.debugv("Validating HTTP message body {0}", parameter);
            violations.addAll(validator.validate(parameter, groups));
        }
View Full Code Here


    }

    private void scanMethod(Method method) {
        Integer messageBodyIndex = null;
        Set<Integer> otherValidatedParameters = new HashSet<Integer>();
        ValidateRequest interceptorBinding = getInterceptorBinding(method);

        log.debugv("This is the first time {0} is invoked. Scanning.", method);

        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (int i = 0; i < parameterAnnotations.length; i++) {
View Full Code Here

        metadata.addMethodMetadata(new MethodMetadata(method, messageBodyIndex, otherValidatedParameters, interceptorBinding));
    }

    private ValidateRequest getInterceptorBinding(Method method) {
        // check for @ValidateRequest on method
        ValidateRequest interceptorBinding = AnnotationInspector.getAnnotation(method, ValidateRequest.class, manager);
        // check for @ValidateRequest on class
        if (interceptorBinding == null) {
            interceptorBinding = AnnotationInspector.getAnnotation(method.getDeclaringClass(), ValidateRequest.class, manager);
        }
        if (interceptorBinding == null) {
View Full Code Here

TOP

Related Classes of org.jboss.seam.rest.validation.ValidateRequest

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.