Package org.jboss.forge.parser.java

Examples of org.jboss.forge.parser.java.JavaAnnotation.addAnnotation()


         type.setPackage(pckg);
      }

      if (documented)
      {
         type.addAnnotation(Documented.class);
      }
      if (retentionPolicy != null)
      {
         type.addAnnotation(Retention.class).setEnumValue(retentionPolicy);
      }
View Full Code Here


      {
         type.addAnnotation(Documented.class);
      }
      if (retentionPolicy != null)
      {
         type.addAnnotation(Retention.class).setEnumValue(retentionPolicy);
      }
      final Set<ElementType> targetTypes;
      if (noTarget)
      {
         targetTypes = Collections.emptySet();
View Full Code Here

      {
         shell.printlnVerbose("Skipping @Target annotation");
      }
      else
      {
         type.addAnnotation(Target.class).setEnumValue(targetTypes.toArray(new ElementType[targetTypes.size()]));
      }

      if (!type.hasSyntaxErrors())
      {
         java.saveJavaSource(type);
View Full Code Here

      {
         JavaSourceFacet javaSourceFacet = getSelectedProject(context).getFacet(JavaSourceFacet.class);
         JavaResource javaResource = context.getUIContext().getSelection();
         JavaAnnotation constraint = (JavaAnnotation) javaResource.getJavaSource();
         // Constraint annotation header
         constraint.addAnnotation(Constraint.class).setStringValue("validatedBy = {}");
         constraint.addAnnotation(ReportAsSingleViolation.class);
         constraint.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         constraint.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE, CONSTRUCTOR);
         constraint.addAnnotation(Documented.class);
         // Constraint annotation body
View Full Code Here

         JavaSourceFacet javaSourceFacet = getSelectedProject(context).getFacet(JavaSourceFacet.class);
         JavaResource javaResource = context.getUIContext().getSelection();
         JavaAnnotation constraint = (JavaAnnotation) javaResource.getJavaSource();
         // Constraint annotation header
         constraint.addAnnotation(Constraint.class).setStringValue("validatedBy = {}");
         constraint.addAnnotation(ReportAsSingleViolation.class);
         constraint.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         constraint.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE, CONSTRUCTOR);
         constraint.addAnnotation(Documented.class);
         // Constraint annotation body
         constraint.addAnnotationElement("String message() default \"Invalid value\"");
View Full Code Here

         JavaResource javaResource = context.getUIContext().getSelection();
         JavaAnnotation constraint = (JavaAnnotation) javaResource.getJavaSource();
         // Constraint annotation header
         constraint.addAnnotation(Constraint.class).setStringValue("validatedBy = {}");
         constraint.addAnnotation(ReportAsSingleViolation.class);
         constraint.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         constraint.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE, CONSTRUCTOR);
         constraint.addAnnotation(Documented.class);
         // Constraint annotation body
         constraint.addAnnotationElement("String message() default \"Invalid value\"");
         constraint.addAnnotationElement("Class<?>[] groups() default { }");
View Full Code Here

         JavaAnnotation constraint = (JavaAnnotation) javaResource.getJavaSource();
         // Constraint annotation header
         constraint.addAnnotation(Constraint.class).setStringValue("validatedBy = {}");
         constraint.addAnnotation(ReportAsSingleViolation.class);
         constraint.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         constraint.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE, CONSTRUCTOR);
         constraint.addAnnotation(Documented.class);
         // Constraint annotation body
         constraint.addAnnotationElement("String message() default \"Invalid value\"");
         constraint.addAnnotationElement("Class<?>[] groups() default { }");
         constraint.addAnnotationElement("Class<? extends Payload>[] payload() default { }");
View Full Code Here

         // Constraint annotation header
         constraint.addAnnotation(Constraint.class).setStringValue("validatedBy = {}");
         constraint.addAnnotation(ReportAsSingleViolation.class);
         constraint.addAnnotation(Retention.class).setEnumValue(RUNTIME);
         constraint.addAnnotation(Target.class).setEnumValue(METHOD, FIELD, PARAMETER, TYPE, ANNOTATION_TYPE, CONSTRUCTOR);
         constraint.addAnnotation(Documented.class);
         // Constraint annotation body
         constraint.addAnnotationElement("String message() default \"Invalid value\"");
         constraint.addAnnotationElement("Class<?>[] groups() default { }");
         constraint.addAnnotationElement("Class<? extends Payload>[] payload() default { }");
View Full Code Here

         type.setPackage(pckg);
      }

      if (documented)
      {
         type.addAnnotation(Documented.class);
      }
      if (retentionPolicy != null)
      {
         type.addAnnotation(Retention.class).setEnumValue(retentionPolicy);
      }
View Full Code Here

      {
         type.addAnnotation(Documented.class);
      }
      if (retentionPolicy != null)
      {
         type.addAnnotation(Retention.class).setEnumValue(retentionPolicy);
      }
      if (!type.hasSyntaxErrors())
      {
         java.saveJavaSource(type);
      }
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.