3 Replies Latest reply on Mar 20, 2008 5:26 PM by msznapka.martin.sznapka.gmail.com

    try catch around annotated method

    msznapka.martin.sznapka.gmail.com

      Hello,
      I want to make something like this:


      my source code:


      @Name("helloWorld")
      public class HelloWorld {
      
          @Action
          public String actionMethod() {
              //actionMethod content
          }
      
          //other methods
      }
      



      result behaviour:


      @Name("helloWorld")
      public class HelloWorld {
      
          public String actionMethod() {
              try {
                  //actionMethod content
              }
              catch(Exception e) {
                  //
              }
          }
      
          //other methods
      }
      



      So I want to annotate method with my annotation (@Action) and in the result the method content is surrounded with some code (here it is try catch).


      Have anyone some ideas how to achieve this?
      I was thinking about using source generated annotations or interceptors.