Hello agian,

the intention was to change the Variable parameters after compiling. But now I've seen, that it will only have effect befor parsing the pattern. So my intention is invalid, but perhaps the altering of the variables should be forbidden, after compiling the pattern, but I know, that produdes a lot of Interfaces or other code changes, because there are a lot of changes necessary on other code points ...

First check, then write to mailing list, Mr. Koops. :-)

regards
  Stephan

Stephan Koops schrieb:
Hello,

while using the class org.restleut.util.Template I detect that the variable-List (Template.getVariables()) is not updated while parsing the given pattern. Is that planned, or is it a bug? I'm using the Restlet-Trunk.

If this should be changed, then we should consider, that the variables are only available after parsing the regexPattern. This will be done on first using ( match(.) or parse(..) ), but the variables should be availabe after creation for updating, I think. Perhaps the method getRegexPattern should be called in the constructor to ensure the validaty of the variables.
I think that the same manner apply for the variableNames.

Another point:
I think that is not good, that the list of the variables ans the map of the variableNamess are modifiable after retrieving it via the public methods. But I am a student; on university you lerned this. Perhaps it is in irrelevant in the daily praxis :-). When we start here than we have to change this at a lot of points in the code, I suspect. When it shoud be changed, than an internal private getter getVariablesInternal() or something like that for modifiable returning is needed.

Jerome: If it should be changed, I send you a ne version of the class.

best regards
  Stephan

Reply via email to