Variables Class

com.bea.p13n.ad
Variables Class

public class Variables

    extends Object

Utility class to handle replacing ${varname} style variables in Strings.

Related Topics

VariableFinder


Hierarchy
Object
  Variables

Constructor Summary

Variables()

 

Method Summary

public static VariableFinder
createAppNameVariableFinder()
public static String
fixAppName(String in)
Replaces all ${APPNAME}s in the input string with the current application name, if there is one.
public static String
varSubstitute(String inStr, VariableFinder vars)
Perform variable substitution (${varname}) on the specified string using the given variable name to value map.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Constructor Detail

Variables

public Variables()
 

Method Detail

createAppNameVariableFinder() Method

public static VariableFinder createAppNameVariableFinder()

fixAppName(String) Method

public static String fixAppName(String in)
Replaces all ${APPNAME}s in the input string with the current application name, if there is one.


varSubstitute(String, VariableFinder) Method

public static String varSubstitute(String inStr, 
                                   VariableFinder vars)
Perform variable substitution (${varname}) on the specified string using the given variable name to value map.

This does not handle any kind of escape sequences (e.g. "\${varname}" would still be replaced).

Parameters

inStr
the input string.
vars
the map of variable names to values.

Returns

the new string.