Class ParameterRefReplacer
java.lang.Object
de.aristaflow.adept2.model.common.paramref.ParameterRefParser
de.aristaflow.adept2.model.common.paramref.ParameterRefReplacer
Facilitates the process of parameterised strings and replace the parameter
references with values. It works similarly to
Matcher and is supposed
to be used in a loop like this:
ParameterRefReplacer replacer = ...
while (replacer.findNext())
{
... replacer.getName() ...
... replacer.getDataType() ...
...
replacer.replaceWith(<someValue>);
}
System.out.println(replacer.getProcessedString());
Instances are created using
ParameterRefTools.getReplacer(String, EnumSet) or other specialised
variants like
SystemDataTools.getReplacer(String).-
Method Summary
Modifier and TypeMethodDescriptionbooleanfindNext()Finds the next parameter reference.Returns the processed string.voidreplaceWith(String string) Replace the current parameter reference with the specified string.Methods inherited from class de.aristaflow.adept2.model.common.paramref.ParameterRefParser
getDataType, getEnd, getName, getParameterisedString, getParameterRef, getStart, getUdtName
-
Method Details
-
findNext
public boolean findNext()Finds the next parameter reference. Once this method returnsfalsetheprocessed stringis complete.- Overrides:
findNextin classParameterRefParser- Returns:
- if a next parameter reference was found
-
replaceWith
Replace the current parameter reference with the specified string. This method is optional, i.e. not every parameter reference must be replaced.- Parameters:
string- the string to replace the current parameter reference with
-
getProcessedString
Returns the processed string.- Returns:
- the processed string
-