Package org.jboss.forge.parser.java

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


      JavaClass entity = context.getEntity();
      Project project = context.getProject();
      String contentType = context.getContentType();
      if (!entity.hasAnnotation(XmlRootElement.class))
      {
         entity.addAnnotation(XmlRootElement.class);
         project.getFacet(JavaSourceFacet.class).saveJavaSource(entity);
      }
      String idType = ResourceGeneratorUtil.resolveIdType(entity);
      String persistenceUnitName = context.getPersistenceUnitName();
      String idGetterName = ResourceGeneratorUtil.resolveIdGetterName(entity);
View Full Code Here


      JavaClass ejb = javaSourceFactory.create(JavaClass.class)
               .setName(className)
               .setPublic()
               .getOrigin();

      ejb.addAnnotation(type.getAnnotation());
      if (EJBType.MESSAGEDRIVEN != type)
      {
         ejb.addAnnotation("javax.ejb.LocalBean");
      }
View Full Code Here

               .getOrigin();

      ejb.addAnnotation(type.getAnnotation());
      if (EJBType.MESSAGEDRIVEN != type)
      {
         ejb.addAnnotation("javax.ejb.LocalBean");
      }

      if (serializable)
      {
         ejb.addInterface(Serializable.class);
View Full Code Here

      {
         annotation = ejb.getAnnotation(TransactionAttribute.class);
      }
      else
      {
         annotation = ejb.addAnnotation(TransactionAttribute.class);
      }
      annotation.setEnumValue(type.getValue());
     
      resource.setContents(ejb);
View Full Code Here

               .setPublic()
               .addAnnotation(Entity.class).getOrigin()
               .addInterface(Serializable.class);
      if (tableName != null && !tableName.isEmpty())
      {
         javaClass.addAnnotation(Table.class).setStringValue("name", tableName);
      }
      if (entityPackage != null && !entityPackage.isEmpty())
      {
         javaClass.setPackage(entityPackage);
      }
View Full Code Here

      final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      for (JavaResource jr : javaTargets)
      {
         JavaClass entity = (JavaClass) (jr).getJavaSource();
         if (!entity.hasAnnotation(XmlRootElement.class))
            entity.addAnnotation(XmlRootElement.class);

         CompiledTemplateResource template = compiler.compileResource(getClass().getResourceAsStream(
                  "/org/jboss/forge/rest/Endpoint.jv"));

         Map<Object, Object> map = new HashMap<Object, Object>();
View Full Code Here

      final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      for (JavaResource jr : javaTargets)
      {
         JavaClass entity = (JavaClass) (jr).getJavaSource();
         if (!entity.hasAnnotation(XmlRootElement.class))
            entity.addAnnotation(XmlRootElement.class);

         CompiledTemplateResource template = compiler.compileResource(getClass().getResourceAsStream(
                  "/org/jboss/forge/rest/Endpoint.jv"));

         Map<Object, Object> map = new HashMap<Object, Object>();
View Full Code Here

      JavaClass plugin = JavaParser.create(JavaClass.class);
      plugin.setPackage(packg);
      plugin.addInterface(Plugin.class);
      plugin.setName(className);

      plugin.addAnnotation(Alias.class).setStringValue(pluginName.toLowerCase());

      plugin.addField().setPrivate().setName("prompt").setType(ShellPrompt.class).addAnnotation(Inject.class);
      plugin.addImport(PipeOut.class);
      plugin.addImport(Option.class);
View Full Code Here

      JavaClass entity = context.getEntity();
      Project project = context.getProject();
      String contentType = context.getContentType();
      if (!entity.hasAnnotation(XmlRootElement.class))
      {
         entity.addAnnotation(XmlRootElement.class);
         project.getFacet(JavaSourceFacet.class).saveJavaSource(entity);
      }
      String idType = ResourceGeneratorUtil.resolveIdType(entity);
      String persistenceUnitName = context.getPersistenceUnitName();
      String idGetterName = ResourceGeneratorUtil.resolveIdGetterName(entity);
View Full Code Here

      final JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);
      for (JavaResource jr : javaTargets)
      {
         JavaClass entity = (JavaClass) (jr).getJavaSource();
         if (!entity.hasAnnotation(XmlRootElement.class))
            entity.addAnnotation(XmlRootElement.class);

         String idType = resolveIdType(entity);
         if (!Types.isBasicType(idType))
         {
            ShellMessages.error(out, "Skipped class [" + entity.getQualifiedName() + "] because @Id type [" + idType
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.