|
Metadata |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.metadata.remote.MetadataResource
public class MetadataResource
Each package has a standard set of resources named PropertyBundle. These resources can be string values, integers, boolean, or even images. A compiled java file is used to store these resources. ResourceBundle is the standard Java mechanism used for this purpose. We wrap some nice helper methods to ease the conversion of data into usable values. Example usage: ( normally you just need to pass the current class to the constructor so the correct package can be used. )
static MetadataResource bundle = new MetadataResource( "com.sas.metadata" ); ... cancelButton = new JButton( bundle.getString("Common.Cancel.txt") );Or If needed a specific resource class can be used (if you use this feature you probably should create a new package):
static WAdminResource bundle = new WAdminResource(); ... bundle.load( "com.sas.metadata.FilterEditDialogResourceBundle" ); ... cancelButton = new JButton( bundle.getString("Common.Cancel.txt") );Helper routines in this module:
Constructor for using the default file for this package. @param String Package name, ie "com.sas.metadata". public WAdminResource( String strResourceFileName ) Prefered constructor, using the default resource bundle file of the package the class resides in. @param Class used to get the package for loading a PropertyBundle class. public MetadataResource( Class source ) Returns a string based on the given key value. "Missing resource" is returned if the key is not present in the resource file. public String getString( String key )
Field Summary | |
---|---|
protected boolean |
m_bResourceFileMissing
have we already looked for the resource bundle for this package and didn't find it? |
protected java.util.ResourceBundle |
m_bundle
The bundle needed for the given class used to create this object. |
protected static java.util.Hashtable |
m_bundleCache
Optimization so that all the classes in a package don't have to load a new copy of the same static resources. |
protected java.lang.String |
m_strResourceFileName
The caller told us the file to open. |
Constructor Summary | |
---|---|
MetadataResource(java.lang.Class source)
|
|
MetadataResource(java.lang.String strResourceFileName)
|
Field Detail |
---|
protected static java.util.Hashtable m_bundleCache
protected boolean m_bResourceFileMissing
protected java.lang.String m_strResourceFileName
protected java.util.ResourceBundle m_bundle
Constructor Detail |
---|
public MetadataResource(java.lang.String strResourceFileName)
public MetadataResource(java.lang.Class source)
Method Detail |
---|
protected java.util.ResourceBundle getCachedBundle(java.lang.String key)
protected void cacheBundle(java.lang.String key, java.util.ResourceBundle bundle)
protected java.util.ResourceBundle _getBundle(java.lang.String strBundlePath)
public java.lang.String getString(java.lang.String key)
public java.lang.String getRawString(java.lang.String key)
public int getInt(java.lang.String key)
public int getInt(java.lang.String key, int notFoundReturnValue)
public byte[] convertHexStringToByteArray(java.lang.String strValue)
protected byte convertHexCharsToByte(byte leftChar, byte rightChar)
public java.lang.String messageString(java.lang.String key)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1, java.lang.Object parm2)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4, java.lang.Object parm5)
public java.lang.String messageString(java.lang.String key, java.lang.Object parm1, java.lang.Object parm2, java.lang.Object parm3, java.lang.Object parm4, java.lang.Object parm5, java.lang.Object parm6)
public java.util.Enumeration getKeys()
|
Metadata |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |