|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.AbstractLogEnabled org.apache.cocoon.i18n.XMLResourceBundle
Implementation of Bundle
interface for XML resources. Represents a
single XML message bundle.
XML format for this resource bundle implementation is the following:
<catalogue xml:lang="en"> <message key="key1">Message <br/> Value 1</message> <message key="key2">Message <br/> Value 1</message> ... </catalogue>
Value can be any well formed XML snippet and it will be cached by the key specified
in the attribute key
. Objects returned by this Bundle
implementation
are instances of the ParamSaxBuffer
class.
If value for a key is not present in this bundle, parent bundle will be queried.
Field Summary | |
static String |
AT_KEY
XML bundle message element's key attribute name |
static String |
EL_CATALOGUE
XML bundle root element name |
static String |
EL_MESSAGE
XML bundle message element name |
protected Bundle |
parent
Parent of the current bundle |
protected Map |
values
Objects stored in the bundle |
Fields inherited from interface org.apache.cocoon.i18n.Bundle |
ROLE |
Constructor Summary | |
XMLResourceBundle(String sourceURI,
Locale locale,
Bundle parent)
Construct a bundle. |
Method Summary | |
Locale |
getLocale()
Gets the locale of the bundle. |
Object |
getObject(String key)
Get an instance of the ParamSaxBuffer associated with the key. |
String |
getSourceURI()
Gets the source URI of the bundle. |
String |
getString(String key)
Get a string representation of the value object by key. |
SourceValidity |
getValidity()
Gets the validity of the bundle. |
protected boolean |
reload(SourceResolver resolver,
long interval)
(Re)Loads the XML bundle if necessary, based on the source URI. |
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String EL_CATALOGUE
public static final String EL_MESSAGE
public static final String AT_KEY
protected Bundle parent
protected Map values
Constructor Detail |
public XMLResourceBundle(String sourceURI, Locale locale, Bundle parent)
sourceURI
- source URI of the XML bundlelocale
- localeparent
- parent bundle of this bundleMethod Detail |
protected boolean reload(SourceResolver resolver, long interval)
public Locale getLocale()
public String getSourceURI()
public SourceValidity getValidity()
public Object getObject(String key)
ParamSaxBuffer
associated with the key.
getObject
in interface Bundle
key
- the key
public String getString(String key)
getString
in interface Bundle
key
- the key
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |