Package org.apache.openjpa.lib.util
Class ParameterTemplate
java.lang.Object
org.apache.openjpa.lib.util.ParameterTemplate
A template that allows parameter substitutions. Parameters should be
placed in the template in the form ${param-name}. Use the
setParameter(java.lang.String, java.lang.Object)
method to set the parameter values, which will be
substituted into the template on calls to write(java.io.OutputStream)
and
toString()
. If a parameter is encountered that hasn't been set, then
the parameter key is used to lookup the corresponding System property.- Author:
- Abe White
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappend
(boolean value) Add the given value to the internal template.append
(char value) Add the given value to the internal template.append
(double value) Add the given value to the internal template.append
(float value) Add the given value to the internal template.append
(int value) Add the given value to the internal template.append
(long value) Add the given value to the internal template.append
(short value) Add the given value to the internal template.Add the given value to the internal template.append
(InputStream in) Add the given value to the internal template.Add the given value to the internal template.Add the given value to the internal template.Add the given value to the internal template.void
Clear the recorded parameter values.getParameter
(String name) Return the value set for the given parameter.boolean
hasParameter
(String name) Return true if the given parameter has been given a value.setParameter
(String name, Object val) Set the value for the given parameter.void
setParameters
(Map params) Set the values for all the parameters in the given map.toString()
Return a copy of the internal value template with all parameters substituted with their current values.void
Write the internal value template with all parameters substituted with their current values.void
write
(OutputStream out) Write the internal value template with all parameters substituted with their current values.void
Write the internal value template with all parameters substituted with their current values.
-
Constructor Details
-
ParameterTemplate
public ParameterTemplate()
-
-
Method Details
-
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template. -
append
Add the given value to the internal template.- Throws:
IOException
-
append
Add the given value to the internal template.- Throws:
IOException
-
append
Add the given value to the internal template.- Throws:
IOException
-
hasParameter
Return true if the given parameter has been given a value. -
getParameter
Return the value set for the given parameter. -
setParameter
Set the value for the given parameter. -
setParameters
Set the values for all the parameters in the given map. -
clearParameters
public void clearParameters()Clear the recorded parameter values. -
toString
Return a copy of the internal value template with all parameters substituted with their current values. -
write
Write the internal value template with all parameters substituted with their current values.- Throws:
IOException
-
write
Write the internal value template with all parameters substituted with their current values.- Throws:
IOException
-
write
Write the internal value template with all parameters substituted with their current values.- Throws:
IOException
-