FreeHEP API
Version current

org.freehep.util.template
Class PropertiesValueProvider

java.lang.Object
  extended byorg.freehep.util.template.PropertiesValueProvider
All Implemented Interfaces:
ValueProvider

public class PropertiesValueProvider
extends Object
implements ValueProvider

A value provider that returns values based on a properties object.

Example of use:

 Hello {v:user.name}
 

Version:
$Id: PropertiesValueProvider.java,v 1.1 2003/01/29 22:55:53 tonyj Exp $
Author:
tonyj
Source Code:
PropertiesValueProvider.java

Constructor Summary
PropertiesValueProvider()
          Builds a PropertiesValueProvider which takes its values from the system properties.
PropertiesValueProvider(Properties props)
          Builds a PropertiesValueProvider which takes its values from the specified Properties object.
 
Method Summary
 String getValue(String name)
          Get a single value
 List getValues(String name)
          Get a list of value providers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesValueProvider

public PropertiesValueProvider()
Builds a PropertiesValueProvider which takes its values from the system properties.

See Also:
System.getProperties()

PropertiesValueProvider

public PropertiesValueProvider(Properties props)
Builds a PropertiesValueProvider which takes its values from the specified Properties object.

Parameters:
props - The properties to use.
Method Detail

getValue

public String getValue(String name)
Description copied from interface: ValueProvider
Get a single value

Specified by:
getValue in interface ValueProvider
Parameters:
name - The name whose value is to be returned
Returns:
The value, or null if undefined.

getValues

public List getValues(String name)
Description copied from interface: ValueProvider
Get a list of value providers. Each item in the returned list must itself be a ValueProvider.

Specified by:
getValues in interface ValueProvider
Parameters:
name - The template name of the list to be returned.
Returns:
The list of value providers, or null if no template is defined.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.