src/main/java/org/apache/bval/bench/jsr303/Jsr303Annotator.java
private ListMultimap<BasicType, Jsr303MetaAnnotationSet> buildBasicTypeAnnotations() {

        ListMultimap<BasicType, Jsr303MetaAnnotationSet> anns = ArrayListMultimap.create();

        HashSet<MetaAnnotation> annotationsSet;
        HashMap<String, Object> annotParams;
        Jsr303MetaAnnotationSet maSet;

        // ### STRING ----------------------------------------------------------

        // @NotNull / "good" / null
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "good"), Lists.newArrayList((Object) null)));

        // [@NotNull, @Size(min=6,max=12)] / [ "goodgood" ] / [ null, "bad" ]
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        annotParams = Maps.newHashMap();
        annotParams.put("min", 6);
        annotParams.put("max", 12);
        annotationsSet.add(new MetaAnnotation(codeModel, Size.class, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "goodgood"), Lists.newArrayList((Object) null, "bad")));
        
        // @GoodCode
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        JDefinedClass goodCode = buildTemplateConstraint("GoodCode");
        goodCode.annotate(Constraint.class).paramArray("validatedBy");
        goodCode.annotate(Pattern.class).param("regexp", ".*");
        JAnnotationArrayMember sizes = goodCode.annotate(Size.List.class).paramArray("value");
        sizes.annotate(Size.class).param("min", 5);
        sizes.annotate(Size.class).param("max", 8);
        goodCode.annotate(NotNull.class);
        annotationsSet.add(new MetaAnnotation(goodCode, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "goodcode", "1234123"), Lists.newArrayList((Object) null, "bad", "acodetoolong")));

        
        // ### INTEGER & INT ---------------------------------------------------

        // @NotNull / 3 / null
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        maSet = new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 3), Lists.newArrayList((Object) null));
        anns.put(BasicType.INTEGER, maSet);
        // This one makes no sense for int

        // @Min(100) @Max(200) / [ 155, null ] / [ -100, 4000 ]
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "must be bigger than {value}");
        annotParams.put("value", 100);
        annotationsSet.add(new MetaAnnotation(codeModel, Min.class, AnnotationType.JSR_303, annotParams));
        annotParams = Maps.newHashMap();
        annotParams.put("message", "must be less than {value}");
        annotParams.put("value", 200);
        annotationsSet.add(new MetaAnnotation(codeModel, Max.class, AnnotationType.JSR_303, annotParams));
        maSet =  new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 155, null), Lists.newArrayList((Object) (-100), 4000));
        anns.put(BasicType.INTEGER, maSet);
        maSet.getValidValues().remove(null);
        anns.put(BasicType.INT, maSet);
        
        // @RangedInt
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        JDefinedClass ranged = buildTemplateConstraint("RangedInt");
        ranged.annotate(Constraint.class).paramArray("validatedBy");
        ranged.annotate(Max.class).param("value", 3000);
        ranged.annotate(Min.class).param("value", 1000);
        ranged.annotate(ReportAsSingleViolation.class);
        annotationsSet.add(new MetaAnnotation(ranged, AnnotationType.JSR_303, annotParams));
        maSet = new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 2500, 3000), Lists.newArrayList((Object) null, -20, 40000000));
        anns.put(BasicType.INTEGER, maSet);
        maSet.getInvalidValues().remove(null);
        anns.put(BasicType.INT, maSet);

        return anns;
    }
/**
     * @return A map of lists of annotation constraints available for every
     *         basic type.
     */
@return A map of lists of annotation constraints available for every
basic type.
@return A map of lists of annotation constraints available for every basic type .
private ListMultimap<BasicType, Jsr303MetaAnnotationSet> buildBasicTypeAnnotations() {
        ListMultimap<BasicType, Jsr303MetaAnnotationSet> anns = ArrayListMultimap.create();
        HashSet<MetaAnnotation> annotationsSet;
        HashMap<String, Object> annotParams;
        Jsr303MetaAnnotationSet maSet;
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "good"), Lists.newArrayList((Object) null)));
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        annotParams = Maps.newHashMap();
        annotParams.put("min", 6);
        annotParams.put("max", 12);
        annotationsSet.add(new MetaAnnotation(codeModel, Size.class, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "goodgood"), Lists.newArrayList((Object) null, "bad")));
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        JDefinedClass goodCode = buildTemplateConstraint("GoodCode");
        goodCode.annotate(Constraint.class).paramArray("validatedBy");
        goodCode.annotate(Pattern.class).param("regexp", ".*");
        JAnnotationArrayMember sizes = goodCode.annotate(Size.List.class).paramArray("value");
        sizes.annotate(Size.class).param("min", 5);
        sizes.annotate(Size.class).param("max", 8);
        goodCode.annotate(NotNull.class);
        annotationsSet.add(new MetaAnnotation(goodCode, AnnotationType.JSR_303, annotParams));
        anns.put(BasicType.STRING, new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) "goodcode", "1234123"), Lists.newArrayList((Object) null, "bad", "acodetoolong")));
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "cannot be null");
        annotationsSet.add(new MetaAnnotation(codeModel, NotNull.class, AnnotationType.JSR_303, annotParams));
        maSet = new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 3), Lists.newArrayList((Object) null));
        anns.put(BasicType.INTEGER, maSet);
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        annotParams.put("message", "must be bigger than {value}");
        annotParams.put("value", 100);
        annotationsSet.add(new MetaAnnotation(codeModel, Min.class, AnnotationType.JSR_303, annotParams));
        annotParams = Maps.newHashMap();
        annotParams.put("message", "must be less than {value}");
        annotParams.put("value", 200);
        annotationsSet.add(new MetaAnnotation(codeModel, Max.class, AnnotationType.JSR_303, annotParams));
        maSet =  new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 155, null), Lists.newArrayList((Object) (-100), 4000));
        anns.put(BasicType.INTEGER, maSet);
        maSet.getValidValues().remove(null);
        anns.put(BasicType.INT, maSet);
        annotationsSet = Sets.newHashSet();
        annotParams = Maps.newHashMap();
        JDefinedClass ranged = buildTemplateConstraint("RangedInt");
        ranged.annotate(Constraint.class).paramArray("validatedBy");
        ranged.annotate(Max.class).param("value", 3000);
        ranged.annotate(Min.class).param("value", 1000);
        ranged.annotate(ReportAsSingleViolation.class);
        annotationsSet.add(new MetaAnnotation(ranged, AnnotationType.JSR_303, annotParams));
        maSet = new Jsr303MetaAnnotationSet(annotationsSet, Lists.newArrayList((Object) 2500, 3000), Lists.newArrayList((Object) null, -20, 40000000));
        anns.put(BasicType.INTEGER, maSet);
        maSet.getInvalidValues().remove(null);
        anns.put(BasicType.INT, maSet);
        return anns;
    }
private ListMultimap < BasicType , Jsr303MetaAnnotationSet > buildBasicTypeAnnotations ( ) { ListMultimap < BasicType , Jsr303MetaAnnotationSet > anns = ArrayListMultimap . create ( ) ; HashSet < MetaAnnotation > annotationsSet ; HashMap < String , Object > annotParams ; Jsr303MetaAnnotationSet maSet ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "message" , "cannot be null" ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , NotNull . class , AnnotationType . JSR_303 , annotParams ) ) ; anns . put ( BasicType . STRING , new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) "good" ) , Lists . newArrayList ( ( Object ) null ) ) ) ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "message" , "cannot be null" ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , NotNull . class , AnnotationType . JSR_303 , annotParams ) ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "min" , 6 ) ; annotParams . put ( "max" , 12 ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , Size . class , AnnotationType . JSR_303 , annotParams ) ) ; anns . put ( BasicType . STRING , new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) "goodgood" ) , Lists . newArrayList ( ( Object ) null , "bad" ) ) ) ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; JDefinedClass goodCode = buildTemplateConstraint ( "GoodCode" ) ; goodCode . annotate ( Constraint . class ) . paramArray ( "validatedBy" ) ; goodCode . annotate ( Pattern . class ) . param ( "regexp" , ".*" ) ; JAnnotationArrayMember sizes = goodCode . annotate ( Size . List . class ) . paramArray ( "value" ) ; sizes . annotate ( Size . class ) . param ( "min" , 5 ) ; sizes . annotate ( Size . class ) . param ( "max" , 8 ) ; goodCode . annotate ( NotNull . class ) ; annotationsSet . add ( new MetaAnnotation ( goodCode , AnnotationType . JSR_303 , annotParams ) ) ; anns . put ( BasicType . STRING , new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) "goodcode" , "1234123" ) , Lists . newArrayList ( ( Object ) null , "bad" , "acodetoolong" ) ) ) ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "message" , "cannot be null" ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , NotNull . class , AnnotationType . JSR_303 , annotParams ) ) ; maSet = new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) 3 ) , Lists . newArrayList ( ( Object ) null ) ) ; anns . put ( BasicType . INTEGER , maSet ) ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "message" , "must be bigger than {value}" ) ; annotParams . put ( "value" , 100 ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , Min . class , AnnotationType . JSR_303 , annotParams ) ) ; annotParams = Maps . newHashMap ( ) ; annotParams . put ( "message" , "must be less than {value}" ) ; annotParams . put ( "value" , 200 ) ; annotationsSet . add ( new MetaAnnotation ( codeModel , Max . class , AnnotationType . JSR_303 , annotParams ) ) ; maSet = new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) 155 , null ) , Lists . newArrayList ( ( Object ) ( - 100 ) , 4000 ) ) ; anns . put ( BasicType . INTEGER , maSet ) ; maSet . getValidValues ( ) . remove ( null ) ; anns . put ( BasicType . INT , maSet ) ; annotationsSet = Sets . newHashSet ( ) ; annotParams = Maps . newHashMap ( ) ; JDefinedClass ranged = buildTemplateConstraint ( "RangedInt" ) ; ranged . annotate ( Constraint . class ) . paramArray ( "validatedBy" ) ; ranged . annotate ( Max . class ) . param ( "value" , 3000 ) ; ranged . annotate ( Min . class ) . param ( "value" , 1000 ) ; ranged . annotate ( ReportAsSingleViolation . class ) ; annotationsSet . add ( new MetaAnnotation ( ranged , AnnotationType . JSR_303 , annotParams ) ) ; maSet = new Jsr303MetaAnnotationSet ( annotationsSet , Lists . newArrayList ( ( Object ) 2500 , 3000 ) , Lists . newArrayList ( ( Object ) null , - 20 , 40000000 ) ) ; anns . put ( BasicType . INTEGER , maSet ) ; maSet . getInvalidValues ( ) . remove ( null ) ; anns . put ( BasicType . INT , maSet ) ; return anns ; }
@return A map of lists of annotation constraints available for every
         basic type.
@return A map of lists of annotation constraints available for every basic type .
// ### STRING ---------------------------------------------------------- // @NotNull / "good" / null // [@NotNull, @Size(min=6,max=12)] / [ "goodgood" ] / [ null, "bad" ] // @GoodCode // ### INTEGER & INT --------------------------------------------------- // @NotNull / 3 / null // This one makes no sense for int // @Min(100) @Max(200) / [ 155, null ] / [ -100, 4000 ] // @RangedInt