Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

SimpleAspect.aj 488B

12345678910111213
  1. import org.aspectj.lang.annotation.Aspect;
  2. import java.lang.annotation.*;
  3. public aspect SimpleAspect {
  4. public static void main(String[] args) {
  5. Annotation[] annotations = SimpleAspect.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. if (!aspectAnnotation.value().equals("")) throw new RuntimeException("value should be empty");
  9. }
  10. }