|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--java.util.Properties | +--saffron.util.SaffronProperties
SaffronProperties
provides an environment for debugging
information, et cetera, used by saffron.
getIntProperty(java.lang.String)
and getBooleanProperty(java.lang.String)
are convenience
methods.
It is a singleton, accessed via the instance()
method. It is
populated from System properties if saffron is invoked via a
main()
method, from a javax.servlet.ServletContext
if
saffron is invoked from a servlet, and so forth. If there is a file
called "saffron.properties"
in the current directory, it is
read too.
For each property "saffron.foo.bar"
used in saffron code,
there should be a String constant called
PROPERTY_saffron_foo_bar
in this class. The javadoc comment
should link to the piece of code which uses that property. (Developers,
please make sure that this remains so!)
Field Summary | |
private static SaffronProperties |
properties
The singleton properties object. |
static String |
PROPERTY_saffron_class_dir
The ""saffron.class.dir"" property is where to compile classes to. |
static String |
PROPERTY_saffron_debug_level
The integer property ""saffron.debug.level"" determines how much debugging information is printed. |
static String |
PROPERTY_saffron_debug_out
The string property ""saffron.debug.out"" is the name of the file to send debugging information to. |
static String |
PROPERTY_saffron_java_compiler_args
The string property ""saffron.java.compiler.args"" is the argument string for the java compiler . |
static String |
PROPERTY_saffron_java_compiler_class
The property ""saffron.java.compiler.class"" is the name of the Java compiler to use. |
static String |
PROPERTY_saffron_java_compiler_class_DEFAULT
Default value for PROPERTY_saffron_java_compiler_class
(""JP.ac.tsukuba.openjava.SunJavaCompiler""). |
static String |
PROPERTY_saffron_java_dir
The string propery ""saffron.java.dir"" is the directory to generate temporary java files to. |
static String |
PROPERTY_saffron_package_name
The string property ""saffron.package.name"" is the package in which to include temporary classes. |
static String |
PROPERTY_saffron_package_name_DEFAULT
Default value for PROPERTY_saffron_package_name
(""saffron.runtime""). |
static String |
PROPERTY_saffron_Statement_printBeforeCompile
If the boolean property ""saffron.Statement.printBeforeCompile"" is true, Statement prints the statement to
System.out before compiling it. |
static String |
PROPERTY_saffron_stupid
The boolean property ""saffron.stupid"" determines whether to optimize variable assignments. |
static String |
PROPERTY_saffron_test_Class
The string property ""saffron.test.Class"" is used by Main.suite() . |
static String |
PROPERTY_saffron_test_jdbc_drivers
The string property ""saffron.test.jdbc.drivers"" is a comma-separated list of class names to be used as JDBC drivers. |
static String |
PROPERTY_saffron_test_jdbc_url
The string property ""saffron.test.jdbc.url"" is the URL of the JDBC database which contains the EMP and DEPT tables used for testing. |
static String |
PROPERTY_saffron_test_Name
The string property ""saffron.test.Name"" is used by Main.suite() . |
static String |
PROPERTY_saffron_test_Suite
The string property ""saffron.test.Suite"" is used by Main.suite() . |
Fields inherited from class java.util.Properties |
defaults |
Fields inherited from class java.util.Hashtable |
|
Constructor Summary | |
private |
SaffronProperties()
Please use instance() to create a SaffronProperties . |
Method Summary | |
void |
apply()
Applies properties to the right locations. |
boolean |
getBooleanProperty(String key)
Retrieves a boolean property. |
int |
getIntProperty(String key)
Retrieves an integer property. |
static SaffronProperties |
instance()
Retrieves the singleton instance of SaffronProperties . |
Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static SaffronProperties properties
public static final String PROPERTY_saffron_class_dir
public static final String PROPERTY_saffron_Statement_printBeforeCompile
Statement
prints the statement to
System.out
before compiling it.
public static final String PROPERTY_saffron_java_compiler_class
JavaCompiler
. The default value is
"PROPERTY_saffron_java_compiler_class_DEFAULT
".
public static final String PROPERTY_saffron_java_compiler_class_DEFAULT
PROPERTY_saffron_java_compiler_class
(""JP.ac.tsukuba.openjava.SunJavaCompiler"").
public static final String PROPERTY_saffron_package_name
PROPERTY_saffron_package_name_DEFAULT
.
public static final String PROPERTY_saffron_package_name_DEFAULT
PROPERTY_saffron_package_name
(""saffron.runtime"").
public static final String PROPERTY_saffron_java_dir
the class root
.
public static final String PROPERTY_saffron_java_compiler_args
java compiler
.
JavaCompilerArgs.setString(java.lang.String)
describes how these
arguments are interpreted.
public static final String PROPERTY_saffron_stupid
public static final String PROPERTY_saffron_debug_level
public static final String PROPERTY_saffron_debug_out
"out"
(the default), means send
to System.out
; "err"
means send to
System.err
.
public static final String PROPERTY_saffron_test_Name
Main.suite()
.
public static final String PROPERTY_saffron_test_Class
Main.suite()
.
public static final String PROPERTY_saffron_test_Suite
Main.suite()
.
public static final String PROPERTY_saffron_test_jdbc_url
public static final String PROPERTY_saffron_test_jdbc_drivers
Constructor Detail |
private SaffronProperties()
instance()
to create a SaffronProperties
.
Method Detail |
public static SaffronProperties instance()
SaffronProperties
.
public void apply()
public int getIntProperty(String key)
public boolean getBooleanProperty(String key)
true
if the
property exists, and its value is 1
, true
or yes
; returns false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |