1. /*
  2. * @(#)RetentionPolicy.java 1.4 04/02/03
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang.annotation;
  8. /**
  9. * Annotation retention policy. The constants of this enumerated type
  10. * describe the various policies for retaining annotations. They are used
  11. * in conjunction with the {@link Retention} meta-annotation type to specify
  12. * how long annotations are to be retained.
  13. *
  14. * @author Joshua Bloch
  15. * @since 1.5
  16. */
  17. public enum RetentionPolicy {
  18. /**
  19. * Annotations are to be discarded by the compiler.
  20. */
  21. SOURCE,
  22. /**
  23. * Annotations are to be recorded in the class file by the compiler
  24. * but need not be retained by the VM at run time. This is the default
  25. * behavior.
  26. */
  27. CLASS,
  28. /**
  29. * Annotations are to be recorded in the class file by the compiler and
  30. * retained by the VM at run time, so they may be read reflectively.
  31. *
  32. * @see java.lang.reflect.AnnotatedElement
  33. */
  34. RUNTIME
  35. }