MetaDone
|
Public Member Functions | |
LoadResourceEvent (Engine engine, Class< T > type, String resourceName) | |
final String | getSource () |
final Class< T > | getType () |
T | getResource () |
void | setResource (T resource) |
T | loadResource () |
byte[] | loadBytes () throws IOException |
Protected Member Functions | |
final byte[] | loadResource (InputStream in) throws IOException |
Private Attributes | |
final String | resourceName |
final Class< T > | type |
T | resource |
Static Private Attributes | |
static final Map< URL, byte[]> | URL_CACHE = Collections.synchronizedMap(new WeakHashMap<URL, byte[]>()) |
An event indicating a request to load a resource.
<T> | The type of the resource |
metadone.client.grasyla2.actions.LoadResourceEvent< T >.LoadResourceEvent | ( | Engine | engine, |
Class< T > | type, | ||
String | resourceName | ||
) |
Initializes this event.
engine | The engine |
type | The class |
resourceName | The name of the resource or its URL |
T metadone.client.grasyla2.actions.LoadResourceEvent< T >.getResource | ( | ) |
Gets the set resource.
final String metadone.client.grasyla2.actions.LoadResourceEvent< T >.getSource | ( | ) |
Implements metadone.publish_subscribe.Event.
final Class<T> metadone.client.grasyla2.actions.LoadResourceEvent< T >.getType | ( | ) |
Gets the type.
byte [] metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadBytes | ( | ) | throws IOException |
Loads an array of bytes from the file represented by the resource name.
IOException | when the resource couldn't be found |
final byte [] metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadResource | ( | InputStream | in | ) | throws IOException [protected] |
Loads a resource from the input stream.
in | The input stream or null |
IOException | when an IO exception occurred |
T metadone.client.grasyla2.actions.LoadResourceEvent< T >.loadResource | ( | ) |
Loads a resource.
This method tries to load the resource, it can also return an already set resource.
void metadone.client.grasyla2.actions.LoadResourceEvent< T >.setResource | ( | T | resource | ) |
Sets the resource.
resource | The new resource |
T metadone.client.grasyla2.actions.LoadResourceEvent< T >.resource [private] |
final String metadone.client.grasyla2.actions.LoadResourceEvent< T >.resourceName [private] |
final Class<T> metadone.client.grasyla2.actions.LoadResourceEvent< T >.type [private] |
final Map<URL, byte[]> metadone.client.grasyla2.actions.LoadResourceEvent< T >.URL_CACHE = Collections.synchronizedMap(new WeakHashMap<URL, byte[]>()) [static, private] |