All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----kh.util.Info
Summary |
public class Info extends java.lang.Object { // Constructors 1 public Info(); // Methods 9 public static boolean getBooleanProperty(String); public static int getIntegerProperty(String) throws NumberFormatException; public static Properties getProperties(); public static String getProperty(String); protected static String getPropertyBase(); public static String getPropertyName(String); public static void initialize(Class); public static String setProperty(String, String); public static void waitToExit(); }
The top level class for all of my applications.
Constructors |
· Info | Summary | Top |
public Info()
Default constructor
Methods |
· getBooleanProperty | Summary | Top |
public static boolean getBooleanProperty(String propName)
Return a boolean property or false if not defined
· getIntegerProperty | Summary | Top |
public static int getIntegerProperty(String propName) throws NumberFormatException
- Returns:
- an integer property or -1 if not defined
· getProperties | Summary | Top |
public static Properties getProperties()
Return a reference to the writable set of properties being used by this class.
· getProperty | Summary | Top |
public static String getProperty(String propName)
A shorthand way to fetch properties for our app
- Returns:
- the property or null if no such property
· getPropertyBase | Summary | Top |
protected static String getPropertyBase()
Returns the prefix applied to all system properties.
- Returns:
- "kh."
· getPropertyName | Summary | Top |
public static String getPropertyName(String prop)
Returns the provided property name with the prefix used by all kh classes.
· initialize | Summary | Top |
public static void initialize(Class srcClass)
Loads the "properties" resource from the specified class. This resource is placed as the default location to find properties for the application.
Typical usage would be to call Info.initialize(this.class) from the main method of your application. You would also place a text file named "properties" in the same directory as your main class file.
Parameter Description srcClass The main application class.
· setProperty | Summary | Top |
public static String setProperty(String propName, String value)
More shorthand, this time for setting a property at run-time
- Returns:
- the old value or null if none
· waitToExit | Summary | Top |
public static void waitToExit()
Frequently we will want to not exit our main app thread until all other non daemon threads have quit. This method verifies that this is true.
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7