|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--org.apache.avalon.excalibur.i18n.AbstractBundle | +--org.apache.avalon.excalibur.i18n.XmlBundle
Inner Class Summary | |
static class |
XmlBundle.ConfigurationKeys
Constants for configuration keys |
Field Summary | |
protected org.apache.avalon.framework.component.ComponentManager |
manager
Component Manager |
Fields inherited from interface org.apache.avalon.excalibur.i18n.Bundle |
ROLE |
Constructor Summary | |
XmlBundle()
|
Method Summary | |
protected org.w3c.dom.Node |
_getNode(org.w3c.dom.Node rootNode,
java.lang.String key)
Get the node with the supplied XPath key, starting from concrete root node. |
protected org.w3c.dom.Node |
_getNode(java.lang.String key)
Get the node with the supplied XPath key. |
protected java.lang.String |
_getString(org.w3c.dom.Node node,
java.lang.String key)
Get value by key from a concrete node. |
protected java.lang.String |
_getString(java.lang.String key)
Get value by key. |
protected void |
cacheAll(org.w3c.dom.Node parent,
java.lang.String pathToParent)
Steps through the bundle tree and stores all text element values in bundle's cache. |
protected boolean |
cacheContains(java.lang.String key)
Does the "key-cache" contain the value with such key? |
protected void |
cacheKey(java.lang.String key,
java.lang.String value)
Cache the key and value in "key-cache". |
protected boolean |
cacheNotFoundContains(java.lang.String key)
Does the "key-not-found-cache" contain such key? |
protected void |
cacheNotFoundKey(java.lang.String key)
Cache the key in "key-not-found-cache". |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
java.lang.String |
convertKey(java.lang.String userKey)
Convert the "user view" of the lookup key to the "system view". |
void |
dispose()
|
org.w3c.dom.Document |
getDocument()
Gets the source DOM tree of the bundle. |
protected java.lang.String |
getFromCache(java.lang.String key)
Gets the value by the key from the "key-cache". |
java.lang.String |
getString(java.lang.String key)
Get value by key. |
protected static java.lang.String |
getTextValue(org.w3c.dom.Node element)
Get the text value of the node. |
void |
initialize()
Initalize the bundle |
void |
initialize(org.xml.sax.InputSource inSource)
Initalize the bundle |
void |
initialize(Source source)
Initalize the bundle |
void |
initialize(java.lang.String uri)
Initalize the bundle |
Methods inherited from class org.apache.avalon.excalibur.i18n.AbstractBundle |
getBundleInfo, getLastModified, getMapper, getParent, getString, setBundleInfo, setLastModified, setMapper, setParent, substitute |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.avalon.framework.component.ComponentManager manager
Constructor Detail |
public XmlBundle()
Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager manager)
compose
in interface org.apache.avalon.framework.component.Composable
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
public void initialize() throws java.lang.Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
document
- XML source document (DOM)public void initialize(java.lang.String uri) throws java.lang.Exception
uri
- URI of the XML sourceIOException
- if an IO error occurs while reading the fileParserConfigurationException
- if no parser is configuredSAXException
- if an error occurs while parsing the filepublic void initialize(Source source) throws java.lang.Exception
file
- XML source fileIOException
- if an IO error occurs while reading the fileParserConfigurationException
- if no parser is configuredSAXException
- if an error occurs while parsing the filepublic void initialize(org.xml.sax.InputSource inSource) throws java.lang.Exception
inStream
- XML source streamIOException
- if an IO error occurs while reading the fileParserConfigurationException
- if no parser is configuredSAXException
- if an error occurs while parsing the filepublic java.lang.String convertKey(java.lang.String userKey)
convertKey
in class AbstractBundle
key
- user keypublic org.w3c.dom.Document getDocument()
protected boolean cacheContains(java.lang.String key)
key
- the key to the value to be returnedprotected boolean cacheNotFoundContains(java.lang.String key)
key
- the key to the value to be returnedprotected void cacheKey(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the valueprotected void cacheNotFoundKey(java.lang.String key)
key
- the keyprotected java.lang.String getFromCache(java.lang.String key)
key
- the keyprotected void cacheAll(org.w3c.dom.Node parent, java.lang.String pathToParent)
parent
- parent node, must be an elementpathToParent
- XPath to the parent nodepublic java.lang.String getString(java.lang.String key) throws java.util.MissingResourceException
key
- keyjava.util.MissingResourceException
- if value was not foundprotected java.lang.String _getString(java.lang.String key)
key
- the keyprotected java.lang.String _getString(org.w3c.dom.Node node, java.lang.String key)
node
- the nodekey
- the keyprotected static java.lang.String getTextValue(org.w3c.dom.Node element)
node
- the nodeprotected org.w3c.dom.Node _getNode(java.lang.String key)
key
- the keyprotected org.w3c.dom.Node _getNode(org.w3c.dom.Node rootNode, java.lang.String key)
rootNode
- the root nodekey
- the keypublic void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |