All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.awb.util.Resource

java.lang.Object
   |
   +----com.ibm.awb.util.Resource

public class Resource
extends Object
The Resource class


Method Index

 o appendResource(String, String)
Appends a value to a resource.
 o createResource(String, Properties)
Creates named resources with default Proeprties object.
 o createResource(String, String, Properties)
Creates named resources with file and default Proeprties object.
 o getBoolean(String, boolean)
 o getColor(String, Color)
 o getFont(String, Font)
 o getInteger(String, int)
 o getPersistentResourcesStartsWith(String)
Get the resources starting with the key
 o getResourceFor(String)
Get the resource object by name.
 o getString(String)
 o getString(String, String)
 o getStringArray(String, String)
 o getURL(String, URL)
 o importOptionProperties(String)
Imports all properties start with "key" into this resource.
 o list(PrintStream)
 o load(URL)
Loads the properties from the file
 o mergeResource(String, String)
Merge a value to a resource.
 o removeOptionResource(String)
 o removePersistentResourcesStartsWith(String)
 o removeResource(String)
 o save(String)
Saves the properties into the default file.
 o save(URL, String)
Saves the properties into the file with given header.
 o setDefaultResource(String, String)
Sets default properties.
 o setOptionResource(String, String)
Sets an option property.
 o setResource(String, String)
Sets a property.
 o toString(Color)
Convenient function to convert Color object to string representation.
 o toString(Font)
Convenient function to convert Font object to string representation.

Methods

 o getResourceFor
 public static Resource getResourceFor(String name)
Get the resource object by name.

 o createResource
 public static synchronized Resource createResource(String name,
                                                    String urlfile,
                                                    Properties defaults) throws MalformedURLException
Creates named resources with file and default Proeprties object.

See Also:
getResourceFor
 o createResource
 public static synchronized Resource createResource(String name,
                                                    Properties defaults)
Creates named resources with default Proeprties object.

See Also:
getResourceFor
 o importOptionProperties
 public void importOptionProperties(String startsWith)
Imports all properties start with "key" into this resource. All imported properties are removed from "from" object.

 o 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
 o 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
 o 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
 o removeResource
 public void removeResource(String key)
 o removeOptionResource
 public void removeOptionResource(String key)
 o 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
 o 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.
 o getPersistentResourcesStartsWith
 public String[] getPersistentResourcesStartsWith(String startsWith)
Get the resources starting with the key

Parameters:
key - the key to search
 o removePersistentResourcesStartsWith
 public void removePersistentResourcesStartsWith(String startsWith)
 o getString
 public String getString(String key)
 o getString
 public String getString(String key,
                         String defaultValue)
 o getBoolean
 public boolean getBoolean(String key,
                           boolean defaultValue)
 o getInteger
 public int getInteger(String key,
                       int defaultValue)
 o getStringArray
 public String[] getStringArray(String key,
                                String sep)
 o getURL
 public URL getURL(String key,
                   URL defaultValue)
 o getFont
 public Font getFont(String key,
                     Font defaultFont)
 o getColor
 public Color getColor(String key,
                       Color defaultColor)
 o toString
 public static String toString(Font font)
Convenient function to convert Font object to string representation.

 o toString
 public static String toString(Color color)
Convenient function to convert Color object to string representation.

 o 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
 o save
 public boolean save(String header)
Saves the properties into the default file.

Parameters:
header - header string
 o load
 public boolean load(URL loadFrom)
Loads the properties from the file

 o list
 public void list(PrintStream out)

All Packages  Class Hierarchy  This Package  Previous  Next  Index