This class represents the {http location} extension property of the
BindingOperation
component which maps to the
whttp:location
extension attribute of the WSDL binding <operation> element, as defined by the WSDL 2.0 HTTP binding extensions.
The value of the whttp:location
attribute may contain templates in which elements from the instance data of the message to be serialized in the request IRI are cited by enclosing their local name within curly braces. A template can then be substituted by matching the local name against an element in the instance data and replacing the template in the HTTP Location with the String value of that element.
For example, consider the HTTP Location "temperature/{town}" and the message data element <town>Sydney</town>
. After substitution, the formatted HTTP Location is "temperature/Sydney". Note, that the entire template "{town}" is replaced by the matching element's value, "Sydney".
If a template is not matched against the instance data, it is replaced in the formatted HTTP Location by the empty string (in other words, it is omitted).
This class has one constructor and this takes a String representing a whttp:location
value, which may contain the curly brace templates described above. The class can perform template substitution and return the formatted HTTP Location resulting from such substitution. It can also return the original HTTP Location value specified on the constructor, so that even after substitution it is possible to see where any templates were used.
This class uses the EBNF grammar defined for {http location} by the WSDL 2.0 HTTP binding extensions to parse and validate the original HTTP Location string. It checks that any single left and right curly braces are correctly paired to enclose a String that is of the correct type to represent an element local name (that is, a String of type xs:NCName).
It also supports the double curly brace syntax used to represent a literal single curly brace in the formatted HTTP Location. That is, a double curly brace escapes a literal single curly brace to avoid mistaking it for a template. For example, "abc{{def" is formatted as "abc{def" and this literal left brace is not interpreted as the beginning of a template.
@author John Kaputin (jkaputin@apache.org)