1. /*
  2. * @(#)AssertionStatusDirectives.java 1.3 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang;
  8. /**
  9. * A collection of assertion status directives (such as "enable assertions
  10. * in package p" or "disable assertions in class c"). This class is used by
  11. * the JVM to communicate the assertion status directives implied by
  12. * the <tt>java</tt> command line flags <tt>-enableassertions</tt>
  13. * (<tt>-ea</tt>) and <tt>-disableassertions</tt> (<tt>-da</tt>).
  14. *
  15. * @since 1.4
  16. * @author Josh Bloch
  17. */
  18. class AssertionStatusDirectives {
  19. /**
  20. * The classes for which assertions are to be enabled or disabled.
  21. * The strings in this array are fully qualified class names (for
  22. * example,"com.xyz.foo.Bar").
  23. */
  24. String[] classes;
  25. /**
  26. * A parallel array to <tt>classes</tt>, indicating whether each class
  27. * is to have assertions enabled or disabled. A value of <tt>true</tt>
  28. * for <tt>classEnabled[i]</tt> indicates that the class named by
  29. * <tt>classes[i]</tt> should have assertions enabled; a value of
  30. * <tt>false</tt> indicates that it should have classes disabled.
  31. * This array must have the same number of elements as <tt>classes</tt>.
  32. *
  33. * <p>In the case of conflicting directives for the same class, the
  34. * last directive for a given class wins. In other words, if a string
  35. * <tt>s</tt> appears multiple times in the <tt>classes</tt> array
  36. * and <tt>i</t> is the highest integer for which
  37. * <tt>classes[i].equals(s)</tt>, then <tt>classEnabled[i]</tt>
  38. * indicates whether assertions are to be enabled in class <tt>s</tt>.
  39. */
  40. boolean[] classEnabled;
  41. /**
  42. * The package-trees for which assertions are to be enabled or disabled.
  43. * The strings in this array are compete or partial package names
  44. * (for example, "com.xyz" or "com.xyz.foo").
  45. */
  46. String[] packages;
  47. /**
  48. * A parallel array to <tt>packages</tt>, indicating whether each
  49. * package-tree is to have assertions enabled or disabled. A value of
  50. * <tt>true</tt> for <tt>packageEnabled[i]</tt> indicates that the
  51. * package-tree named by <tt>packages[i]</tt> should have assertions
  52. * enabled; a value of <tt>false</tt> indicates that it should have
  53. * assertions disabled. This array must have the same number of
  54. * elements as <tt>packages</tt>.
  55. *
  56. * In the case of conflicting directives for the same package-tree, the
  57. * last directive for a given package-tree wins. In other words, if a
  58. * string <tt>s</tt> appears multiple times in the <tt>packages</tt> array
  59. * and <tt>i</t> is the highest integer for which
  60. * <tt>packages[i].equals(s)</tt>, then <tt>packageEnabled[i]</tt>
  61. * indicates whether assertions are to be enabled in package-tree
  62. * <tt>s</tt>.
  63. */
  64. boolean[] packageEnabled;
  65. /**
  66. * Whether or not assertions in non-system classes are to be enabled
  67. * by default.
  68. */
  69. boolean deflt;
  70. }