Details
-
Type:
Wish
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Translations
-
Labels:None
Description
Usually expression contains several nested levels of variables, that needs more then one iterations to get the wanted result .
For instance:
<variable name="Folder.bin" value="@{MyFolder}/bin" condition="OS_IS_UNIX.Condition"/>
<variable name="Folder.Main" value="@{Product.Folder}" condition="OS_IS_WINDOWS.Condition"/>
<variable name="Folder.Main" value="$USER_HOME" condition="OS_IS_UNIX.Condition"/>
Therefor we need set of new methods do it
For example:
public String recursiveSubstitute(String exp)
{ substituteFragmentation(exp, "@"); } public String substituteFragmentation(String exp, String chr)
{
1. Checks betweens @{<name>}abcd..., so removes the first char @
2. Checks for the same character before and after the name like %<name>% or @<name>@abcd...
3. Checks after single char @<name>abcd...
4. non of them ...
}
vois <some of the above methods>(String name)
{
1. We translate the "name" to new exp'
2. We perform recursive checking on this new exp' with recursiveSubstitute() method
}
Sorry for the mistake
This is what I meant
<variable name="Folder.bin" value="@{Folder.Main}/bin" condition="OS_IS_UNIX.Condition"/>
<variable name="Folder.Main" value="@{Product.Folder}" condition="OS_IS_WINDOWS.Condition"/>
<variable name="Folder.Main" value="$USER_HOME" condition="OS_IS_UNIX.Condition"/>