您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314
  1. import org.aspectj.lang.annotation.Aspect;
  2. import java.lang.annotation.*;
  3. public aspect SA {
  4. public static void main(String[] args) {
  5. Annotation[] annotations = SA.class.getAnnotations();
  6. if (annotations.length != 1) throw new RuntimeException("Should have one annotation but has "+annotations.length);
  7. Aspect aspectAnnotation = (Aspect) annotations[0];
  8. System.out.println(aspectAnnotation);
  9. if (!aspectAnnotation.value().equals("")) throw new RuntimeException("value should be empty");
  10. }
  11. }