Package javax.validation.executable

Examples of javax.validation.executable.ValidateOnExecution.type()


     * @param element element to be examined for {@link ValidateOnExecution}.
     * @return set of executable types or an empty set if the element is not annotated with {@link ValidateOnExecution}.
     */
    private Set<ExecutableType> getExecutableTypes(final AnnotatedElement element) {
        final ValidateOnExecution validateExecutable = element.getAnnotation(ValidateOnExecution.class);
        return validateExecutable != null ? Sets.newHashSet(validateExecutable.type()) : Collections.<ExecutableType>emptySet();
    }

    /**
     * Get a class hierarchy for the given {@code clazz} suitable to be looked for {@link ValidateOnExecution} annotation
     * in order according to the priority defined by Bean Validation spec (superclasses, interfaces).
View Full Code Here


     * @param element element to be examined for {@link ValidateOnExecution}.
     * @return set of executable types or an empty set if the element is not annotated with {@link ValidateOnExecution}.
     */
    private Set<ExecutableType> getExecutableTypes(final AnnotatedElement element) {
        final ValidateOnExecution validateExecutable = element.getAnnotation(ValidateOnExecution.class);
        return validateExecutable != null ? Sets.newHashSet(validateExecutable.type()) : Collections.<ExecutableType>emptySet();
    }

    /**
     * Get a class hierarchy for the given {@code clazz} suitable to be looked for {@link ValidateOnExecution} annotation
     * in order according to the priority defined by Bean Validation spec (superclasses, interfaces).
View Full Code Here

         {
            types = defaultValidatedExecutableTypes;
         }
         else
         {
            if (voe.type().length > 0)
            {
               types = voe.type();
            }
            else
            {
View Full Code Here

         }
         else
         {
            if (voe.type().length > 0)
            {
               types = voe.type();
            }
            else
            {
               types = defaultValidatedExecutableTypes;
            }
View Full Code Here

   }
  
   static protected ExecutableType[] getExecutableTypesOnMethod(Method method)
   {
     ValidateOnExecution voe = method.getAnnotation(ValidateOnExecution.class);
     if (voe == null || voe.type().length == 0)
     {
       return null;
     }
     ExecutableType[] types = voe.type();
     if (types == null || types.length == 0)
View Full Code Here

     ValidateOnExecution voe = method.getAnnotation(ValidateOnExecution.class);
     if (voe == null || voe.type().length == 0)
     {
       return null;
     }
     ExecutableType[] types = voe.type();
     if (types == null || types.length == 0)
     {
       return null;
     }
     return types;
View Full Code Here

                if (constructorValidated == null) {
                    final ValidateOnExecution annotation = targetClass.getConstructor(constructor.getParameterTypes()).getAnnotation(ValidateOnExecution.class);
                    if (annotation == null) {
                        constructorValidated = classConfiguration.contains(ExecutableType.CONSTRUCTORS);
                    } else {
                        final Collection<ExecutableType> types = Arrays.asList(annotation.type());
                        constructorValidated = types.contains(ExecutableType.CONSTRUCTORS) || types.contains(ExecutableType.IMPLICIT) || types.contains(ExecutableType.ALL);
                    }
                }
            }
        }
View Full Code Here

                    if (validateOnExecution == null) {
                        methodConfig = doValidMethod(method, classConfiguration);
                    } else {
                        final Collection<ExecutableType> config = new HashSet<ExecutableType>();
                        for (final ExecutableType type : validateOnExecution.type()) {
                            if (ExecutableType.IMPLICIT.equals(type)) { // on method it just means validate, even on getters
                                config.add(ExecutableType.NON_GETTER_METHODS);
                                if (lastClassWithTheMethod == null) {
                                    config.add(ExecutableType.GETTER_METHODS);
                                } // else the annotation was not on the method so implicit doesn't mean getters
View Full Code Here

                    final ValidateOnExecution annotation = targetClass.getAnnotation(ValidateOnExecution.class);
                    if (annotation == null) {
                        classConfiguration.addAll(globalConfiguration.getGlobalExecutableTypes());
                    } else {
                        for (final ExecutableType type : annotation.type()) {
                            if (ExecutableType.IMPLICIT.equals(type)) {
                                classConfiguration.add(ExecutableType.CONSTRUCTORS);
                                classConfiguration.add(ExecutableType.NON_GETTER_METHODS);
                            } else if (ExecutableType.ALL.equals(type)) {
                                classConfiguration.add(ExecutableType.CONSTRUCTORS);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.