|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.ws.wadl.ast.PathSegment
public class PathSegment
Represents a segment of a URI with zero or more embedded parameters as found in the path attribute of a WADL resource element. Embedded parameters are represented as {name} where name is the name of the parameter. This class also maintains the list of matrix parameters, query parameters and any addition parameter information supplied using a child WADL param element.
| Constructor Summary | |
|---|---|
PathSegment(ResourceType resource,
URI file,
ElementResolver idMap)
Creates a new instance of PathSegment from a WADL resource type element. |
|
PathSegment(Resource resource,
URI file,
ElementResolver idMap)
Creates a new instance of PathSegment from a WADL resource element. |
|
PathSegment(String template)
Construct a PathSegment instance using a string representation. |
|
PathSegment(String template,
List<String> matrixParameters)
Construct a PathSegment instance using a string representation and a list of matrix parameter names. |
|
| Method Summary | |
|---|---|
protected static Param |
derefIfRequired(Param p,
URI file,
ElementResolver idMap)
Dereference a param reference element if required. |
String |
evaluate(Map<String,Object> parameterValues)
Merges the supplied parameter values into the path segment template and returns the resulting path segment. |
List<Param> |
getHeaderParameters()
Get list of header parameters attached to the path segment. |
List<Param> |
getMatrixParameters()
Get list of matrix parameters attached to the path segment. |
List<Param> |
getQueryParameters()
Get list of query parameters attached to the path segment. |
String |
getTemplate()
Get the underlying path segment template string. |
List<Param> |
getTemplateParameters()
Get a list of parameters embedded within the underlying path segment template. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathSegment(String template)
template - the string version of the template.
public PathSegment(String template,
List<String> matrixParameters)
template - the string version of the template.matrixParameters - a list of matrix parameter names.
public PathSegment(Resource resource,
URI file,
ElementResolver idMap)
throws InvalidWADLException
resource - the WADL resource element.file - the URI of the WADL file that contains the resource element.idMap - a map of URI reference to WADL definition element.
InvalidWADLException - when WADL is invalid and cannot be processed.
public PathSegment(ResourceType resource,
URI file,
ElementResolver idMap)
throws InvalidWADLException
resource - the WADL resource type element.file - the URI of the WADL file that contains the resource type element.idMap - a map of URI reference to WADL definition element.
InvalidWADLException - when WADL is invalid and cannot be processed.| Method Detail |
|---|
protected static Param derefIfRequired(Param p,
URI file,
ElementResolver idMap)
throws InvalidWADLException
p - the param reference or definition.file - the URI of the WADL file containing the param reference or definition.idMap - a map of URI reference to WADL definition element.
InvalidWADLException - when WADL is invalid and cannot be processed.public String getTemplate()
public List<Param> getTemplateParameters()
public List<Param> getMatrixParameters()
public List<Param> getQueryParameters()
public List<Param> getHeaderParameters()
public String evaluate(Map<String,Object> parameterValues)
parameterValues - a map of parameter names to values. Values can be of any class, evaluate uses
the object's toString method to obtain the stringified value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||