com.calitha.resource
Class JavaResource

java.lang.Object
  extended by com.calitha.resource.Resource
      extended by com.calitha.resource.BinaryResource
          extended by com.calitha.resource.JavaResource
All Implemented Interfaces:
IResource

public final class JavaResource
extends BinaryResource

A JavaResource object represents a resource that uses the classloader to locate resources.

Author:
Robert van Loenhout

Constructor Summary
JavaResource(Locale locale, String namespace, String id, String mimetype, String name)
          Creates a new JavaResource object.
 
Method Summary
 byte[] getBytes()
          Gets the content of the resource as a byte array.
 String getName()
          Gets the name of the resource that is used to locate the resource.
 
Methods inherited from class com.calitha.resource.BinaryResource
getText, getText
 
Methods inherited from class com.calitha.resource.Resource
createKey, equals, getId, getKey, getLocale, getMimetype, getNamespace, hashCode, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaResource

public JavaResource(Locale locale,
                    String namespace,
                    String id,
                    String mimetype,
                    String name)
Creates a new JavaResource object.

Parameters:
locale - locale
namespace - namespace
id - id
mimetype - mimetype
name - name
Throws:
IllegalArgumentException - if an argument is null
Method Detail

getName

public String getName()
Gets the name of the resource that is used to locate the resource.

Returns:
resource name

getBytes

public byte[] getBytes()
Description copied from interface: IResource
Gets the content of the resource as a byte array.

Returns:
bytes