01: /*
02: * @(#)AssertionStatusDirectives.java 1.6 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package java.lang;
28:
29: /**
30: * A collection of assertion status directives (such as "enable assertions
31: * in package p" or "disable assertions in class c"). This class is used by
32: * the JVM to communicate the assertion status directives implied by
33: * the <tt>java</tt> command line flags <tt>-enableassertions</tt>
34: * (<tt>-ea</tt>) and <tt>-disableassertions</tt> (<tt>-da</tt>).
35: *
36: * @since 1.4
37: * @author Josh Bloch
38: */
39: class AssertionStatusDirectives {
40: /**
41: * The classes for which assertions are to be enabled or disabled.
42: * The strings in this array are fully qualified class names (for
43: * example,"com.xyz.foo.Bar").
44: */
45: String[] classes;
46:
47: /**
48: * A parallel array to <tt>classes</tt>, indicating whether each class
49: * is to have assertions enabled or disabled. A value of <tt>true</tt>
50: * for <tt>classEnabled[i]</tt> indicates that the class named by
51: * <tt>classes[i]</tt> should have assertions enabled; a value of
52: * <tt>false</tt> indicates that it should have classes disabled.
53: * This array must have the same number of elements as <tt>classes</tt>.
54: *
55: * <p>In the case of conflicting directives for the same class, the
56: * last directive for a given class wins. In other words, if a string
57: * <tt>s</tt> appears multiple times in the <tt>classes</tt> array
58: * and <tt>i</t> is the highest integer for which
59: * <tt>classes[i].equals(s)</tt>, then <tt>classEnabled[i]</tt>
60: * indicates whether assertions are to be enabled in class <tt>s</tt>.
61: */
62: boolean[] classEnabled;
63:
64: /**
65: * The package-trees for which assertions are to be enabled or disabled.
66: * The strings in this array are compete or partial package names
67: * (for example, "com.xyz" or "com.xyz.foo").
68: */
69: String[] packages;
70:
71: /**
72: * A parallel array to <tt>packages</tt>, indicating whether each
73: * package-tree is to have assertions enabled or disabled. A value of
74: * <tt>true</tt> for <tt>packageEnabled[i]</tt> indicates that the
75: * package-tree named by <tt>packages[i]</tt> should have assertions
76: * enabled; a value of <tt>false</tt> indicates that it should have
77: * assertions disabled. This array must have the same number of
78: * elements as <tt>packages</tt>.
79: *
80: * In the case of conflicting directives for the same package-tree, the
81: * last directive for a given package-tree wins. In other words, if a
82: * string <tt>s</tt> appears multiple times in the <tt>packages</tt> array
83: * and <tt>i</t> is the highest integer for which
84: * <tt>packages[i].equals(s)</tt>, then <tt>packageEnabled[i]</tt>
85: * indicates whether assertions are to be enabled in package-tree
86: * <tt>s</tt>.
87: */
88: boolean[] packageEnabled;
89:
90: /**
91: * Whether or not assertions in non-system classes are to be enabled
92: * by default.
93: */
94: boolean deflt;
95: }
|