|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.ResourceBundle | +--org.apache.cocoon.i18n.XMLResourceBundle
Field Summary | |
protected static javax.xml.parsers.DocumentBuilderFactory |
docfactory
DOM factory |
protected org.apache.log.Logger |
logger
Logger |
protected org.apache.avalon.framework.component.ComponentManager |
manager
Component Manager |
protected XMLResourceBundle |
parent
Parent of the current bundle |
Constructor Summary | |
XMLResourceBundle()
|
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
|
void |
dispose()
|
org.w3c.dom.Document |
getDocument()
Gets the source DOM tree of the bundle. |
java.util.Enumeration |
getKeys()
Return an enumeration of the keys. |
java.util.Locale |
getLocale()
Gets the locale of the bundle. |
java.lang.String |
getName()
Gets the name of the bundle. |
java.lang.String |
getString(java.lang.String key,
java.util.Map dictionary)
Get value by key and substitute variables. |
protected java.lang.Object |
handleGetObject(java.lang.String key)
Return an Object by key. |
void |
init(java.lang.String name,
java.lang.String fileName,
java.util.Locale locale,
XMLResourceBundle parent,
boolean cacheAtStartup)
Initalize the bundle |
protected static org.w3c.dom.Document |
loadResourceBundle(java.lang.String fileName)
Load the DOM tree, based on the file name. |
void |
setLogger(org.apache.log.Logger logger)
Set the logger. |
java.lang.String |
substitute(java.lang.String value,
java.util.Map dictionary)
Substitute the "variables" in the string with the values provided in the map. |
Methods inherited from class java.util.ResourceBundle |
getBundle, getBundle, getBundle, getObject, getString, getStringArray, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static javax.xml.parsers.DocumentBuilderFactory docfactory
protected XMLResourceBundle parent
protected org.apache.log.Logger logger
protected org.apache.avalon.framework.component.ComponentManager manager
Constructor Detail |
public XMLResourceBundle()
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager manager)
compose
in interface org.apache.avalon.framework.component.Composable
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public void init(java.lang.String name, java.lang.String fileName, java.util.Locale locale, XMLResourceBundle parent, boolean cacheAtStartup) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
name
- name of the bundlefileName
- name of the XML source filelocale
- localeparent
- parent bundle of this bundlecacheAtStartup
- cache all the keys when constructing?java.io.IOException
- if an IO error occurs while reading the filejavax.xml.parsers.ParserConfigurationException
- if no parser is configuredorg.xml.sax.SAXException
- if an error occurs while parsing the fileprotected static org.w3c.dom.Document loadResourceBundle(java.lang.String fileName) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
fileName
- name of the XML source filejava.io.IOException
- if an IO error occurs while reading the filejavax.xml.parsers.ParserConfigurationException
- if no parser is configuredorg.xml.sax.SAXException
- if an error occurs while parsing the filepublic java.lang.String getName()
public org.w3c.dom.Document getDocument()
public java.util.Locale getLocale()
getLocale
in class java.util.ResourceBundle
public java.lang.String getString(java.lang.String key, java.util.Map dictionary) throws java.util.MissingResourceException
key
- keydictionary
- map with variable valuesjava.util.MissingResourceException
- if resource was not foundpublic java.lang.String substitute(java.lang.String value, java.util.Map dictionary)
value
- value where to search for variablesdictionary
- map with variable valuespublic void setLogger(org.apache.log.Logger logger)
setLogger
in interface org.apache.avalon.framework.logger.Loggable
logger
- the loggerprotected java.lang.Object handleGetObject(java.lang.String key) throws java.util.MissingResourceException
handleGetObject
in class java.util.ResourceBundle
key
- the keypublic java.util.Enumeration getKeys()
getKeys
in class java.util.ResourceBundle
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |