org.apache.avalon.excalibur.i18n
Class AbstractBundle

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.avalon.excalibur.i18n.AbstractBundle
All Implemented Interfaces:
Bundle, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.LogEnabled
Direct Known Subclasses:
XmlBundle

public abstract class AbstractBundle
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements Bundle, org.apache.avalon.framework.component.Component


Fields inherited from interface org.apache.avalon.excalibur.i18n.Bundle
ROLE
 
Constructor Summary
AbstractBundle()
           
 
Method Summary
 java.lang.String convertKey(java.lang.String userKey)
          Convert the "user view" of the lookup key to the "system view".
 BundleInfo getBundleInfo()
          Get the bundle info.
 long getLastModified()
          Returns the last modification time of this bundle, in milliseconds.
 BundleInfoMapper getMapper()
           
 Bundle getParent()
          Get the parent bundle of the current bundle.
 java.lang.String getString(java.lang.String key, java.util.Map variables)
          Get value by key and substitute variables.
 void setBundleInfo(BundleInfo bundleInfo)
          Set the bundle info.
 void setLastModified(long lastModified)
          Sets the last modification time of this bundle, in milliseconds.
 void setMapper(BundleInfoMapper mapper)
          Set the bundle info mapper.
 void setParent(Bundle parent)
          Set the parent bundle of the current bundle.
 java.lang.String substitute(java.lang.String value, java.util.Map values)
          Substitute the "variables" in the string with the values provided in the map.
 
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
 
Methods inherited from interface org.apache.avalon.excalibur.i18n.Bundle
getString
 

Constructor Detail

AbstractBundle

public AbstractBundle()
Method Detail

getBundleInfo

public BundleInfo getBundleInfo()
Get the bundle info.
Specified by:
getBundleInfo in interface Bundle

setBundleInfo

public void setBundleInfo(BundleInfo bundleInfo)
Set the bundle info.
Specified by:
setBundleInfo in interface Bundle

getMapper

public BundleInfoMapper getMapper()

setMapper

public void setMapper(BundleInfoMapper mapper)
Description copied from interface: Bundle
Set the bundle info mapper.
Specified by:
setMapper in interface Bundle

getParent

public Bundle getParent()
Get the parent bundle of the current bundle.
Specified by:
getParent in interface Bundle
Returns:
the parent bundle

setParent

public void setParent(Bundle parent)
Set the parent bundle of the current bundle.
Specified by:
setParent in interface Bundle
Parameters:
parent - the parent bundle

getLastModified

public long getLastModified()
Returns the last modification time of this bundle, in milliseconds.
Specified by:
getLastModified in interface Bundle
Returns:
last modification time, -1 if N/A

setLastModified

public void setLastModified(long lastModified)
Sets the last modification time of this bundle, in milliseconds.
Specified by:
setLastModified in interface Bundle
Parameters:
lastModified - last modification time

getString

public java.lang.String getString(java.lang.String key,
                                  java.util.Map variables)
Get value by key and substitute variables.
Specified by:
getString in interface Bundle
Parameters:
key - key
variables - map with variable values
Returns:
value with variable values substituted
Throws:
MissingResourceException - if value was not found

convertKey

public java.lang.String convertKey(java.lang.String userKey)
Convert the "user view" of the lookup key to the "system view". Used to hide the implemented storage mechanism and/or XML file schema. The default implementation just returns the key "as-is".
Specified by:
convertKey in interface Bundle
Parameters:
key - user key
Returns:
system key

substitute

public java.lang.String substitute(java.lang.String value,
                                   java.util.Map values)
Substitute the "variables" in the string with the values provided in the map.
Parameters:
value - value where to search for variables
dictionary - map with variable values
Returns:
value with variable values substituted


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.