Avalon Excalibur



Jakarta main

Avalon main

About
  • Overview
  • Changes
  • Download
  • API Docs


  • Released Components
  • Command-Line Inspection
  • Collections
  • Component Utilities
  • Concurrent Threading
  • DataSource Management
  • IO Utilities
  • Pooling Support
  • Property Utilities


  • Components under Development
  • Internationalization
  • Piping Support
  • Proxy Implementation
  • Thread Pool Management



  • Avalon Excalibur : Property Utilities


    Manage Context Properties Easily

    Avalon Excalibur uses the properties package located at org.apache.avalon.excalibur.properties to decode resolvable properties. The Avalon Framework Context object stores values based on name/value pairs. If the value is resolvable, then it is possible to alter the value based on another value in the Context.

    For example, you can get a Context value like this:

         Object val =
             PropertyUtil.resolveProperty("component-${parent}", mycontext, false);
         

    The PropertyUtil will first lookup the value named "parent" from the context, and replace "${parent}" with the value of what "parent" was (for our purpose we will say it was "foo"). Then it will look up the value of "component-foo" from the Context. The last parameter if true will not throw an exception if the resource was not found, and if false will throw an exception.


    by Berin Loritsch, Leo Simons



    Copyright © 1999-2001 The Apache Software Foundation. All Rights Reserved.