Author: wglass Date: Tue Oct 18 21:15:55 2005 New Revision: 326373 URL: http://svn.apache.org/viewcvs?rev=326373&view=rev Log: Added get method to parallel setAttribute method. VELOCITY-412.
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java?rev=326373&r1=326372&r2=326373&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java Tue Oct 18 21:15:55 2005 @@ -629,6 +629,32 @@ { ri.setApplicationAttribute(key, value); } + + /** + * <p> + * Return an ApplicationAttribue, which is an Object + * set by the application which is accessable from + * any component of the system that gets a RuntimeServices. + * This allows communication between the application + * environment and custom pluggable components of the + * Velocity engine, such as loaders and loggers. + * </p> + * + * <p> + * Note that there is no enfocement or rules for the key + * used - it is up to the application developer. However, to + * help make the intermixing of components possible, using + * the target Class name (e.g. com.foo.bar ) as the key + * might help avoid collision. + * </p> + * + * @param key object 'name' under which the object is stored + * return value object to store under this key + */ + public Object getApplicationAttribute( Object key ) + { + return ri.getApplicationAttribute(key); + } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java?rev=326373&r1=326372&r2=326373&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java Tue Oct 18 21:15:55 2005 @@ -332,6 +332,15 @@ public Object getApplicationAttribute( Object key ); /** + * Set the specified application attribute. + * + * @param key The name of the attribute to set. + * @param value The attribute value to set. + * @return the displaced attribute value + */ + public Object setApplicationAttribute( Object key, Object value ); + + /** * Returns the configured class introspection/reflection * implemenation. */ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]