|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.woden.wsdl20.extensions.http.HTTPLocation
This class represents the {http location} extension property of the
BindingOperation
component and the whttp:location
extension
attribute of the WSDL binding <operation> element, as defined by the
WSDL 2.0 HTTP binding extensions.
The HTTP location may be used as a template in which local names of elements
from the instance data of the message to be serialized in request IRI are
cited by enclosing the element name within curly braces (e.g. "temperature/{town}").
A curly brace-enclosed element name is substituted with the value of that
element from the instance data when the request IRI is constructed.
This class has a single constructor which takes a String argument representing the original value of the HTTP location, which may be templated with the curly brace syntax described above. An object of this class represents only that HTTP location string (i.e. the location template cannot be modified). The class does have methods to substitute element values for local names and to return the derived HTTP location after substitution has occurred.
This class performs syntax validation of the original HTTP location template, checking that any single left and right curly braces are used correctly as pairs enclosing a String that is of the correct format to represent an element local name (i.e. of type xs:NCName). It also handles the double curly brace syntax defined by this extension to represent literal single curly braces in the derived location value. For example, "abc{{def" becomes "abc{def" in the derived location and this literal left brace is not used for matching purposes with a right curly brace.
TODO Replace behaviour described below with new EBNF grammar added to spec to fix this ambiguity
The specification of the WSDL 2.0 HTTP Binding extensions does not explicitly state how to interpret extraneous, unmatched curly braces, so this class adopts the following strategy:
If multiple single left braces precede a right brace, pair the right most one with the right brace and treat the others as unmatched left braces.
e.g. "{..{..{xxxx}"If multiple single right braces follow a left brace, pair the left most one with the left brace and treat the others as unmatched right braces.
e.g. "{xxxx}..}..}"Double left or right braces take precedence over potentially matching pairs of single braces.
e.g. "{xxxx}}}" is evaluated as {xxxx,}},} not as {xxxx},}}
Constructor Summary | |
HTTPLocation(java.lang.String location)
This constructor creates an HTTPLocation object from the specified String. |
Method Summary | |
java.lang.String |
getFormattedLocation()
Same behaviour as toString() |
java.lang.String |
getOriginalLocation()
TODO javadoc. |
HTTPLocationTemplate |
getTemplate(java.lang.String name)
Return the first template with the specified name. |
HTTPLocationTemplate |
getTemplateInPath(java.lang.String name)
Return the first template from the path with the specified name. |
HTTPLocationTemplate |
getTemplateInQuery(java.lang.String name)
Return the first template from the query with the specified name. |
java.lang.String[] |
getTemplateNames()
Return names of all templates in this HTTP location in the order they appear. |
java.lang.String[] |
getTemplateNamesInPath()
Return names of all templates from the path portion of this HTTP location in the order they appear. |
java.lang.String[] |
getTemplateNamesInQuery()
Return names of all templates from the query portion of this HTTP location in the order they appear. |
HTTPLocationTemplate[] |
getTemplates()
Return all templates in this HTTP location. |
HTTPLocationTemplate[] |
getTemplates(java.lang.String name)
Return an array of templates with the specified name. |
HTTPLocationTemplate[] |
getTemplatesInPath()
Return the templates in this HTTP location that appear in the path. |
HTTPLocationTemplate[] |
getTemplatesInPath(java.lang.String name)
Return an array of templates from the path with the specified name. |
HTTPLocationTemplate[] |
getTemplatesInQuery()
Return the templates in this HTTP location that appear in the query. |
HTTPLocationTemplate[] |
getTemplatesInQuery(java.lang.String name)
Return an array of templates from the query with the specified name. |
boolean |
isLocationValid()
TODO javadoc. |
java.lang.String |
toString()
Returns a String representing the HTTP Location template with any element name/value substitution that has taken place via the substitute methods. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HTTPLocation(java.lang.String location)
whttp:location
attribute within a binding operation element.
The location template String argument must not be null.
location
- the String value of the http locationMethod Detail |
public boolean isLocationValid()
public java.lang.String getOriginalLocation()
public java.lang.String getFormattedLocation()
public java.lang.String toString()
substitute
methods.
If any element local name has not yet been substituted with a value then that
local name will appear in the String in its original template form, enclosed in
curly braces.
If the HTTP Location does not contain any curly brace template syntax then substitution
is not applicable and this method will return the same String value as the
getLocationTemplate()
method.
public HTTPLocationTemplate[] getTemplates()
public HTTPLocationTemplate[] getTemplatesInPath()
public HTTPLocationTemplate[] getTemplatesInQuery()
public java.lang.String[] getTemplateNames()
public java.lang.String[] getTemplateNamesInPath()
public java.lang.String[] getTemplateNamesInQuery()
public HTTPLocationTemplate getTemplate(java.lang.String name)
public HTTPLocationTemplate[] getTemplates(java.lang.String name)
public HTTPLocationTemplate getTemplateInPath(java.lang.String name)
public HTTPLocationTemplate[] getTemplatesInPath(java.lang.String name)
public HTTPLocationTemplate getTemplateInQuery(java.lang.String name)
public HTTPLocationTemplate[] getTemplatesInQuery(java.lang.String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |