KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > AssertionStatusDirectives


1 /*
2  * @(#)AssertionStatusDirectives.java 1.4 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang;
9
10 /**
11  * A collection of assertion status directives (such as "enable assertions
12  * in package p" or "disable assertions in class c"). This class is used by
13  * the JVM to communicate the assertion status directives implied by
14  * the <tt>java</tt> command line flags <tt>-enableassertions</tt>
15  * (<tt>-ea</tt>) and <tt>-disableassertions</tt> (<tt>-da</tt>).
16  *
17  * @since 1.4
18  * @author Josh Bloch
19  */

20 class AssertionStatusDirectives {
21     /**
22      * The classes for which assertions are to be enabled or disabled.
23      * The strings in this array are fully qualified class names (for
24      * example,"com.xyz.foo.Bar").
25      */

26     String JavaDoc[] classes;
27
28     /**
29      * A parallel array to <tt>classes</tt>, indicating whether each class
30      * is to have assertions enabled or disabled. A value of <tt>true</tt>
31      * for <tt>classEnabled[i]</tt> indicates that the class named by
32      * <tt>classes[i]</tt> should have assertions enabled; a value of
33      * <tt>false</tt> indicates that it should have classes disabled.
34      * This array must have the same number of elements as <tt>classes</tt>.
35      *
36      * <p>In the case of conflicting directives for the same class, the
37      * last directive for a given class wins. In other words, if a string
38      * <tt>s</tt> appears multiple times in the <tt>classes</tt> array
39      * and <tt>i</t> is the highest integer for which
40      * <tt>classes[i].equals(s)</tt>, then <tt>classEnabled[i]</tt>
41      * indicates whether assertions are to be enabled in class <tt>s</tt>.
42      */

43     boolean[] classEnabled;
44
45     /**
46      * The package-trees for which assertions are to be enabled or disabled.
47      * The strings in this array are compete or partial package names
48      * (for example, "com.xyz" or "com.xyz.foo").
49      */

50     String JavaDoc[] packages;
51
52     /**
53      * A parallel array to <tt>packages</tt>, indicating whether each
54      * package-tree is to have assertions enabled or disabled. A value of
55      * <tt>true</tt> for <tt>packageEnabled[i]</tt> indicates that the
56      * package-tree named by <tt>packages[i]</tt> should have assertions
57      * enabled; a value of <tt>false</tt> indicates that it should have
58      * assertions disabled. This array must have the same number of
59      * elements as <tt>packages</tt>.
60      *
61      * In the case of conflicting directives for the same package-tree, the
62      * last directive for a given package-tree wins. In other words, if a
63      * string <tt>s</tt> appears multiple times in the <tt>packages</tt> array
64      * and <tt>i</t> is the highest integer for which
65      * <tt>packages[i].equals(s)</tt>, then <tt>packageEnabled[i]</tt>
66      * indicates whether assertions are to be enabled in package-tree
67      * <tt>s</tt>.
68      */

69     boolean[] packageEnabled;
70
71     /**
72      * Whether or not assertions in non-system classes are to be enabled
73      * by default.
74      */

75     boolean deflt;
76 }
77
Popular Tags