junit.extensions.xml
Class XMLPropertyCache

java.lang.Object
  extended byjunit.extensions.xml.XMLObjectCache
      extended byjunit.extensions.xml.XMLPropertyCache

public class XMLPropertyCache
extends XMLObjectCache

Title: XMLObjectCache

Description: Multi level hashmap to contain name value pairs. A parent level can be explicitly accessed by prefixing the name with "../" otherwise the parent level will only be searched if the object does not exist at the current level.

Copyright: Copyright (c) 2003

Company: jfcunit project

Version:
1.0
Author:
Kevin Wilson

Field Summary
 
Fields inherited from class junit.extensions.xml.XMLObjectCache
 
Constructor Summary
XMLPropertyCache()
          Empty contructor.
XMLPropertyCache(XMLPropertyCache parent)
          Constructor.
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Get a object from the cache.
 java.lang.String resolve(java.lang.String s)
          Resolve any parameter names in the string given, and make the appropriate substitutions.
 
Methods inherited from class junit.extensions.xml.XMLObjectCache
clear, getName, getNames, getParent, put, remove, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLPropertyCache

public XMLPropertyCache()
Empty contructor. Parent is assumed to be null. It can be set at a later time.


XMLPropertyCache

public XMLPropertyCache(XMLPropertyCache parent)
Constructor.

Parameters:
parent - Parent object cache to be set.
Method Detail

get

public java.lang.Object get(java.lang.String name)
Get a object from the cache. If the object does not exist in the cache then try the parent cache. If a parent cache does not exist then try the System properties.

Overrides:
get in class XMLObjectCache
Parameters:
name - Name of the value to be retrieved.
Returns:
Return the value.

resolve

public final java.lang.String resolve(java.lang.String s)
Resolve any parameter names in the string given, and make the appropriate substitutions.

Parameters:
s - String String which may contain the property names.
Returns:
String Resuting string which will have the property values substituted.


Licensed under: GNU Lesser General Public License, Ver 2.1, February 1999