org.freehep.util.template
Class PropertiesValueProvider
- java.lang.Object
-
- org.freehep.util.template.PropertiesValueProvider
-
- All Implemented Interfaces:
- ValueProvider
public class PropertiesValueProvider extends java.lang.Object implements ValueProvider
A value provider that returns values based on a properties object.Example of use:
Hello {v:user.name}
-
-
Constructor Summary
Constructors Constructor and Description PropertiesValueProvider()Builds a PropertiesValueProvider which takes its values from the system properties.PropertiesValueProvider(java.util.Properties props)Builds a PropertiesValueProvider which takes its values from the specified Properties object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetValue(java.lang.String name)Get a single valuejava.util.ListgetValues(java.lang.String name)Get a list of value providers.
-
-
-
Constructor Detail
-
PropertiesValueProvider
public PropertiesValueProvider()
Builds a PropertiesValueProvider which takes its values from the system properties.- See Also:
System.getProperties()
-
PropertiesValueProvider
public PropertiesValueProvider(java.util.Properties props)
Builds a PropertiesValueProvider which takes its values from the specified Properties object.- Parameters:
props- The properties to use.
-
-
Method Detail
-
getValue
public java.lang.String getValue(java.lang.String name)
Description copied from interface:ValueProviderGet a single value- Specified by:
getValuein interfaceValueProvider- Parameters:
name- The name whose value is to be returned- Returns:
- The value, or
nullif undefined.
-
getValues
public java.util.List getValues(java.lang.String name)
Description copied from interface:ValueProviderGet a list of value providers. Each item in the returned list must itself be a ValueProvider.- Specified by:
getValuesin interfaceValueProvider- Parameters:
name- The template name of the list to be returned.- Returns:
- The list of value providers, or
nullif no template is defined.
-
-
DMelt 3.0 © DataMelt by jWork.ORG