avignon.handlers.helpers
Class ParameterString

java.lang.Object
  extended byavignon.handlers.helpers.ParameterString
All Implemented Interfaces:
java.lang.Cloneable

public class ParameterString
extends java.lang.Object
implements java.lang.Cloneable

Helper class for replacing parts of a string.


Constructor Summary
ParameterString(java.lang.String value)
          Creates a parameter string that replaces null actual parameters with the empty string.
ParameterString(java.lang.String value, java.lang.String nullReplacement)
          Creates a parameter string that replaces null actal parameters with the given value.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
          Standard equals method.
 void replaceFormalParameter(java.lang.String formalParameter, java.lang.Object actualParameter)
          Replaces all occurrences of the text of the formal parameter with the text of the actual parameter with the ParameterString.
 java.lang.String toString()
          Returns a string representation of the parameter string as modified by any calls to replaceFormalParameters.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterString

public ParameterString(java.lang.String value)
Creates a parameter string that replaces null actual parameters with the empty string.

Parameters:
value - Source string in which to replace parameters.

ParameterString

public ParameterString(java.lang.String value,
                       java.lang.String nullReplacement)
Creates a parameter string that replaces null actal parameters with the given value.

Parameters:
value - Source string in which to replace parameters.
nullReplacement - Value to use when a null actual parameter is encountered.
Method Detail

replaceFormalParameter

public void replaceFormalParameter(java.lang.String formalParameter,
                                   java.lang.Object actualParameter)
Replaces all occurrences of the text of the formal parameter with the text of the actual parameter with the ParameterString. If the formal parameter appears within the actual parameter, this can lead to an infinite loop. If the actual parameter is null, the null replacement defined when the instance was constructed will be used.

Parameters:
formalParameter -
actualParameter -

toString

public java.lang.String toString()
Returns a string representation of the parameter string as modified by any calls to replaceFormalParameters.

Returns:

equals

public boolean equals(java.lang.Object other)
Standard equals method.

Parameters:
other - The value to be compared.
Returns:
True if 'other' is a ParameterString whose toString returns the same text as this instance.

clone

public java.lang.Object clone()
Returns:

SourceForge.net Logo