Class ResourceDecoder
public abstract class ResourceDecoder
{
// Constructors
public ResourceDecoder();
public ResourceDecoder(InputStream is);
// Methods
public abstract byte[] getBytes(int type, int strId)
throws ResourceFormattingException ;
public abstract byte[] getBytes(int type, String name)
throws ResourceFormattingException ;
public abstract UIDialog getDialog(int dlgId)
throws ResourceFormattingException ;
public abstract UIDialog getDialog(String dlgname)
throws ResourceFormattingException ;
public int getLocale();
public abstract String getString(int strId)
throws ResourceFormattingException ;
public abstract void populateDialog(UIDialog dlg, int dlgId,
int language) throws ResourceFormattingException ;
public abstract void populateDialog(UIDialog dlg, String dlgname,
int language) throws ResourceFormattingException ;
public abstract void setLocale(int locale);
}
This is an abstract class that reads resources from a resource file. The format of the file is unspecified and is left to the classes deriving from this class.
public ResourceDecoder();
Creates an empty resource decoder.
public ResourceDecoder(InputStream is);
Creates a resource decoder based on a byte input stream.
Parameter | Description |
is
| The InputStream object that the decoder is based on.
|
public abstract byte[] getBytes(int type, int strId)
throws ResourceFormattingException ;
Retrieves a byte block, of the resource type specified, with the given string identifier.
Parameter | Description |
type
| The resource type of the byte block.
|
strId
| The string identifier of the byte block.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the resource identifier is not valid.
public abstract byte[] getBytes(int type, String name)
throws ResourceFormattingException ;
Retrieves a byte block, of the resource type specified, with the given name.
Return Value:
Returns the byte array.
Parameter | Description |
type
| The resource type of the byte block.
|
name
| The resource name of the byte block.
|
public abstract UIDialog getDialog(int dlgId)
throws ResourceFormattingException ;
Retrieves a dialog box in the current locale with the specified dialog identifier.
Parameter | Description |
dlgId
| The identifier of the dialog resource.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the dialog identifier is not valid.
public abstract UIDialog getDialog(String dlgname)
throws ResourceFormattingException ;
Retrieves a dialog box in the current locale with the specified name.
Parameter | Description |
dlgname
| The name of the string resource.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the string resource name is not valid.
public int getLocale();
Retrieves the current locale.
Return Value:
Returns the current locale.
public abstract String getString(int strId)
throws ResourceFormattingException ;
Retrieves a string resource, with the specified identifier, in the current locale.
Parameter | Description |
strId
| The identifier of the string resource.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the string identifier is not valid.
public abstract void populateDialog(UIDialog dlg, int dlgId,
int language) throws ResourceFormattingException ;
Fills an existing dialog box with components from a dialog resource using the dialog resource identifier.
Parameter | Description |
dlg
| The dialog object to populate.
|
dlgId
| The identifier of the dialog resource containing the components.
|
language
| The language of the resources to use.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the specified dialog identifier is not valid.
public abstract void populateDialog(UIDialog dlg, String dlgname,
int language) throws ResourceFormattingException ;
Fills an existing dialog box with components such as from a dialog resource using the dialog resource name.
Parameter | Description |
dlg
| The dialog object to populate.
|
dlgname
| The name of the dialog resource containing the components.
|
language
| The language to use.
|
Exceptions:
com.ms.ui.resource.ResourceFormattingException
if the specified dialog name is not valid.
public abstract void setLocale(int locale);
Sets the current locale.
Parameter | Description |
locale
| The locale to be set.
|