Is there a programmatic way to retrieve the variable names defined in
a Template?
I'm building a REST client for our workflow system, and the idea is
that the user can specify an URI Template for the request, say:
http://example.com/users/{user}/genes/{gene}
Now the trick is that I want to extract the list of ["user", "gene"]
so that I can present these as input parameters in the workflow
system. When invoking the REST client (ie. making the request to the
REST server), those variables are to be inserted by the workflow system.
I notice there is a private getRegexVariables() that is almost what I
want, but it's private and I can't see a clever way to get this out
using any of the Template methods.
Do I have to re-parse the template myself? I guess looking for {([^}]
+)} with regular expressions should be enough, but I wanted to check
with the list first.
--
Stian Soiland, myGrid team
School of Computer Science
The University of Manchester
http://www.cs.man.ac.uk/~ssoiland/