org.freehep.util.template
Class PropertiesValueProvider

java.lang.Object
  extended by org.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 8584 2006-08-10 23:06:37Z duns $
Author:
tonyj

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.


Copyright © 2012. All Rights Reserved.