public class Resources extends Object
Modifier and Type | Method and Description |
---|---|
StaticAnimation |
getAnimation(String id)
Deprecated.
use getImage(String) instead
|
String[] |
getAnimationResourceNames()
Deprecated.
use getImageResourceNames instead
|
InputStream |
getData(String id)
Returns the data resource from the file
|
String[] |
getDataResourceNames()
Returns the names of the data resources within this bundle
|
Font |
getFont(String id)
Returns the font resource from the file
|
String[] |
getFontResourceNames()
Returns the names of the fonts within this bundle
|
Image |
getImage(String id)
Returns the image resource from the file
|
String[] |
getImageResourceNames()
Returns the names of the images within this bundle
|
Hashtable |
getL10N(String id,
String locale)
Returns a hashmap containing localized String key/value pairs for the given locale name
|
String[] |
getL10NResourceNames()
Returns the names of the localization bundles within this bundle
|
int |
getMajorVersion()
Returns the version number for this resource file.
|
String[] |
getMetaData()
Returns optional meta-data associated with the resource file
|
int |
getMinorVersion()
Returns the minor version number for this resource file
This value relates to the value from the header defined by the resource file
specification.
|
String[] |
getResourceNames()
Returns the names of the resources within this bundle
|
Hashtable |
getTheme(String id)
Returns the theme resource from the file
|
String[] |
getThemeResourceNames()
Returns the names of the images within this bundle
|
boolean |
isAnimation(String name)
Deprecated.
animations are no longer distinguished from images in the resource file, use Image.isAnimation instead
|
boolean |
isData(String name)
Returns true if this is a data resource
|
boolean |
isFont(String name)
Returns true if this is a font resource
|
boolean |
isImage(String name)
Returns true if this is an image resource
|
boolean |
isL10N(String name)
Returns true if this is a generic data resource
|
boolean |
isTheme(String name)
Returns true if this is a theme resource
|
Enumeration |
listL10NLocales(String id)
Returns an enumration of the locales supported by this resource id
|
static Resources |
open(InputStream resource)
Creates a resource object from the given input stream
|
static Resources |
open(String resource)
Creates a resource object from the local JAR resource identifier
|
public int getMajorVersion()
public int getMinorVersion()
public String[] getMetaData()
public String[] getResourceNames()
public String[] getDataResourceNames()
public String[] getL10NResourceNames()
public String[] getFontResourceNames()
public String[] getThemeResourceNames()
public String[] getImageResourceNames()
public String[] getAnimationResourceNames()
public boolean isL10N(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic boolean isTheme(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic boolean isFont(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic boolean isAnimation(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic boolean isData(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic boolean isImage(String name)
name
- the name of the resourceNullPointerException
- if the resource doesn't existpublic static Resources open(String resource) throws IOException
resource
- a local reference to a resource using the syntax of Class.getResourceAsStream(String)IOException
- if opening/reading the resource failspublic static Resources open(InputStream resource) throws IOException
resource
- stream from which to read the resourceIOException
- if opening/reading the resource failspublic Image getImage(String id)
id
- name of the image resourcepublic StaticAnimation getAnimation(String id)
id
- name of the animation resourcepublic InputStream getData(String id)
id
- name of the data resourcepublic Hashtable getL10N(String id, String locale)
id
- the name of the locale resourcelocale
- name of the locale resourcepublic Enumeration listL10NLocales(String id)
id
- the name of the locale resourcepublic Font getFont(String id)
id
- name of the font resource