Class ibm.awb.util.Resource
All Packages Class Hierarchy This Package Previous Next Index
Class ibm.awb.util.Resource
java.lang.Object
|
+----ibm.awb.util.Resource
- public class Resource
- extends Object
The Resource class
-
appendResource(String, String)
- Appends a value to a resource.
-
createResource(String, URL, Properties)
- Creates named resources with file and default Proeprties object.
-
getBoolean(String, boolean)
-
-
getColor(String, Color)
-
-
getFont(String, Font)
-
-
getInteger(String, int)
-
-
getPersistentResourcesStartsWith(String)
- Get the resources starting with the key
-
getResourceFor(String)
- Get the resource object by name.
-
getString(String)
-
-
getString(String, String)
-
-
getStringArray(String, String)
-
-
getURL(String, URL)
-
-
importOptionProperties(String)
- Imports all properties start with "key" into this resource.
-
list(PrintStream)
-
-
load(URL)
- Loads the properties from the file
-
mergeResource(String, String)
- Merge a value to a resource.
-
removeOptionResource(String)
-
-
removePersistentResourcesStartsWith(String)
-
-
removeResource(String)
-
-
save(String)
- Saves the properties into the default file.
-
save(URL, String)
- Saves the properties into the file with given header.
-
setDefaultResource(String, String)
- Sets default properties.
-
setOptionResource(String, String)
- Sets an option property.
-
setResource(String, String)
- Sets a property.
-
toString(Color)
- Convenient function to convert Color object to string representation.
-
toString(Font)
- Convenient function to convert Font object to string representation.
getResourceFor
public static Resource getResourceFor(String name)
- Get the resource object by name.
createResource
public static synchronized Resource createResource(String name,
URL file,
Properties defaults)
- Creates named resources with file and default Proeprties object.
- See Also:
- getResourceFor
importOptionProperties
public void importOptionProperties(String startsWith)
- Imports all properties start with "key" into this resource.
All imported properties are removed from "from" object.
setDefaultResource
public void setDefaultResource(String key,
String value)
- Sets default properties. Default properties have last priority and
are not persistent.
- Parameters:
- key - the key
- value - the value to be stored as a default
setOptionResource
public void setOptionResource(String key,
String value)
- Sets an option property. Option properties have first priority and
are not persistent. These will not be saved in the file.
- Parameters:
- key - the key
- value - the value to be stored as a option resource
setResource
public void setResource(String key,
String value)
- Sets a property. Option properties are persistent and will be saved
in the strage.
- Parameters:
- key - the key
- value - the value to be stored
removeResource
public void removeResource(String key)
removeOptionResource
public void removeOptionResource(String key)
appendResource
public void appendResource(String key,
String value)
- Appends a value to a resource.
- Parameters:
- key - the key
- value - the value to be append at the end of the original
value
mergeResource
public void mergeResource(String key,
String value)
- Merge a value to a resource. If the same value exists in the
original value, it is just ignored.
- Parameters:
- key - the key
- value - the value to be merged.
getPersistentResourcesStartsWith
public String[] getPersistentResourcesStartsWith(String startsWith)
- Get the resources starting with the key
- Parameters:
- key - the key to search
removePersistentResourcesStartsWith
public void removePersistentResourcesStartsWith(String startsWith)
getString
public String getString(String key)
getString
public String getString(String key,
String defaultValue)
getBoolean
public boolean getBoolean(String key,
boolean defaultValue)
getInteger
public int getInteger(String key,
int defaultValue)
getStringArray
public String[] getStringArray(String key,
String sep)
getURL
public URL getURL(String key,
URL defaultValue)
getFont
public Font getFont(String key,
Font defaultFont)
getColor
public Color getColor(String key,
Color defaultColor)
toString
public static String toString(Font font)
- Convenient function to convert Font object to string representation.
toString
public static String toString(Color color)
- Convenient function to convert Color object to string representation.
save
public boolean save(URL saveTo,
String header)
- Saves the properties into the file with given header.
- Parameters:
- saveTo - the URL pointing to the file location
- header - string to be saved at the top of file
save
public boolean save(String header)
- Saves the properties into the default file.
- Parameters:
- header - header string
load
public boolean load(URL loadFrom)
- Loads the properties from the file
list
public void list(PrintStream out)
All Packages Class Hierarchy This Package Previous Next Index