|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.resource.Resource
com.calitha.resource.TextResource
public final class TextResource
A TextResource object respresents a text resource.
Text resources can be use to make an application support multi-language text messages.
| Constructor Summary | |
|---|---|
TextResource(Locale locale,
String namespace,
String id,
String text)
Creates a new TextResource object. |
|
| Method Summary | |
|---|---|
byte[] |
getBytes()
Gets the content of the resource as a byte array. |
String |
getText()
Gets the content of the resource as a text string. |
String |
getText(Charset encoding)
Gets the content of the resource as a text string. |
String |
toString()
|
void |
toString(StringBuffer buffer)
|
| Methods inherited from class com.calitha.resource.Resource |
|---|
createKey, equals, getId, getKey, getLocale, getMimetype, getNamespace, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextResource(Locale locale,
String namespace,
String id,
String text)
locale - localenamespace - namespaceid - idtext - text
IllegalArgumentException - if an argument is null| Method Detail |
|---|
public String getText()
IResource
public String getText(Charset encoding)
IResourceUseful if the encoding is not part of the resource. For example a file that contains a text string.
encoding - character set such as UTF-8 or ISO-8859-1
public byte[] getBytes()
IResource
public void toString(StringBuffer buffer)
toString in class Resourcepublic String toString()
toString in class Resource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||