|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.resource.Resource
public abstract class Resource
A Resource object represents a resource such as text or a www resource that can be used in your application.
This class must be extended to create a concrete implementation.
| Constructor Summary | |
|---|---|
Resource(Locale locale,
String namespace,
String id,
String mimetype)
Creates a new resource object. |
|
| Method Summary | |
|---|---|
static String |
createKey(String namespace,
String id)
Creates a key used to store a resource in a map. |
boolean |
equals(Object obj)
|
String |
getId()
Gets the id of the resource. |
String |
getKey()
Gets the key of the resource. |
Locale |
getLocale()
Gets the locale that this resource is associated with. |
String |
getMimetype()
Gets the mimetype of the resource. |
String |
getNamespace()
Gets the namespace that the resource is part of. |
int |
hashCode()
|
String |
toString()
|
void |
toString(StringBuffer buffer)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.calitha.resource.IResource |
|---|
getBytes, getText, getText |
| Constructor Detail |
|---|
public Resource(Locale locale,
String namespace,
String id,
String mimetype)
locale - localenamespace - namespaceid - idmimetype - mimetype
IllegalArgumentException - if an argument is null| Method Detail |
|---|
public Locale getLocale()
IResourceEach resource is associated with a particular locale. However both the language and country can be empty mean it can be used for all languages and countries.
getLocale in interface IResourcepublic String getNamespace()
IResource
getNamespace in interface IResourcepublic String getId()
IResource
getId in interface IResourcepublic String getKey()
IResourceThis is a combination of namespace and id. For example: namespace=com.caltiha, id=msg, key=com.calitha.msg If the namespace is null, then the key is the same as the id.
getKey in interface IResourcepublic String getMimetype()
IResource
getMimetype in interface IResourcepublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void toString(StringBuffer buffer)
public String toString()
toString in class Object
public static String createKey(String namespace,
String id)
namespace - namespaceid - id
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||