public class Debug
extends java.lang.Object
The system properties have three classes of "value" data. The string may be equal to the string "true" (case insensitive), it may be parsable into an integer (by Integer.parseInt()), or it may be any other string. In the latter case where it is not TRUE and is not an int, it will be interpreted as a zero if a integer is requested, and FALSE if a boolean is requested.
The following definitions define how integer and boolean settings are interpreted:
Integer.parseInt(java.lang.String, int)
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(java.lang.Class c)
Find out the debugging setting for class c.
|
static boolean |
getBoolean(java.lang.Class c,
java.lang.String suffix)
Find out the debugging setting for class c.
|
static boolean |
getBoolean(java.lang.String s)
Get a named debugging setting.
|
static int |
getInt(java.lang.Class c)
Find out the debugging setting for class c.
|
static int |
getInt(java.lang.Class c,
java.lang.String suffix)
Find out the debugging setting for class c.
|
static int |
getInt(java.lang.String s)
Get a named debugging setting.
|
static java.lang.String |
getSetting(java.lang.String key)
Do a raw lookup of a key, including matching of wildcard settings.
|
static java.io.PrintWriter |
getWriter()
Get the debugging stream, used for writing debug messages.
|
static void |
init(boolean force)
Initialize (or re-initialize) debugging support.
|
static boolean |
isEnabled()
Check if overall debugging is enabled.
|
static void |
print(java.lang.String s)
Print a debugging message.
|
static void |
println(java.lang.String s)
Print a debugging message and end the line.
|
static void |
setProperties(java.util.Properties props)
Set properties containing debugging settings.
|
public static void print(java.lang.String s)
s
- the message to be printed.public static void println(java.lang.String s)
s
- the message to be printed.public static boolean isEnabled()
public static java.lang.String getSetting(java.lang.String key)
key
- The name of the setting to be returnedpublic static boolean getBoolean(java.lang.Class c)
c
- Class whose name should be used to lookup the setting, null results in
a return value of zero.public static boolean getBoolean(java.lang.Class c, java.lang.String suffix)
c
- Class whose name should be used to lookup the setting, null results in
a return value of zero.suffix
- String to append to the classname, null will result in a lookup
of just the classname.public static boolean getBoolean(java.lang.String s)
s
- the name of the desired debugging settingpublic static int getInt(java.lang.Class c)
c
- the class whose name should be used to lookup the settingpublic static int getInt(java.lang.Class c, java.lang.String suffix)
c
- a class whose name should be used to lookup the setting;
null results in a return value of zero.suffix
- a string to append to the classname;
null will result in a lookup of just the classname.public static int getInt(java.lang.String s)
s
- the name of the desired debugging settingpublic static java.io.PrintWriter getWriter()
public static void setProperties(java.util.Properties props)
props
- A table of properties containing debugging settingspublic static void init(boolean force)
force
- Force reprocessing of System properties.Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.