You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyPojo.java 800B

1234567891011121314151617181920212223242526272829303132333435
  1. aspect ConfigureTracing {
  2. declare @type : MyPojo : @Tracing(level = LoggingLevel.WARN);
  3. // declare @method : * MyPojo.calculate() : @TestAnnotation;
  4. }
  5. @interface Tracing { LoggingLevel level(); }
  6. @interface TestAnnotation {}
  7. class Level {
  8. Level(int i) {}
  9. public final static Level INFO = new Level(1);
  10. public final static Level WARN = new Level(2);
  11. public final static Level ERROR = new Level(3);
  12. }
  13. //@Tracing(level = LoggingLevel.WARN)
  14. enum LoggingLevel {
  15. INFO(Level.INFO),
  16. WARN(Level.WARN),
  17. ERROR(Level.ERROR);
  18. private final Level level;
  19. private LoggingLevel(Level level) {this.level = level;}
  20. public Level getLevel() {return level;}
  21. }
  22. public class MyPojo {
  23. public static void calculate() {
  24. }
  25. public static void main(String []argv) {
  26. }
  27. }