com.townleyenterprises.common
Class PropertyResolver

java.lang.Object
  extended bycom.townleyenterprises.common.PropertyResolver

public class PropertyResolver
extends java.lang.Object

This is a decorator class for a java.util.Properties object to provide an extra method for locating properties with a specified prefix.

Version:
$Id: PropertyResolver.java,v 1.2 2004/07/28 10:33:58 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
PropertyResolver(java.util.Properties properties)
          The constructor initializes the instance with the reference to the properties.
 
Method Summary
 java.lang.String get(java.lang.String key)
          This method is just a pass-through to the java.util.Properties.getProperties method.
 java.lang.String get(java.lang.String prefix, java.lang.String key)
          This method provides a way to get compound properties, joined by the '.' character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyResolver

public PropertyResolver(java.util.Properties properties)
The constructor initializes the instance with the reference to the properties.

Parameters:
properties - the Properties to decorate
Method Detail

get

public java.lang.String get(java.lang.String key)
This method is just a pass-through to the java.util.Properties.getProperties method.

Parameters:
key - the property key
Returns:
the property value or null if not present

get

public java.lang.String get(java.lang.String prefix,
                            java.lang.String key)
This method provides a way to get compound properties, joined by the '.' character.

Parameters:
prefix - the prefix for this property
key - the base property key
Returns:
the property value or null if not present


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.