public class Segment extends Object
| Constructor and Description |
|---|
Segment() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(PathParameter parameter)
Add a new parameter to this
Segment's internal list. |
Matcher |
getMatcher(String target)
|
PathParameter |
getParameter(int index)
Get the
PathParameter at the given index. |
List<PathParameter> |
getParameters()
Get an ordered list of the current
PathParameters contained within this Segment. |
String |
getRegex()
Get the parameterized (grouped) regular expression representing this
Segment |
String |
getTemplate()
Get the template representing this
Segment |
static Matcher |
getTemplateMatcher(String target)
Can be used to discover
String representations of template parameters encoded via
parameterize(int) |
int |
numParameters()
Return the number of
PathParameters contained within this Segment. |
static String |
parameterize(int paramIndex)
Return a
String representation of a parameter index value that can be re-discovered via
getTemplateMatcher(String) |
void |
setRegex(String regex) |
void |
setTemplate(String pattern) |
String |
toString() |
public static String parameterize(int paramIndex)
String representation of a parameter index value that can be re-discovered via
getTemplateMatcher(String)public static Matcher getTemplateMatcher(String target)
String representations of template parameters encoded via
parameterize(int)public String getRegex()
Segmentpublic void setRegex(String regex)
public void addParameter(PathParameter parameter)
Segment's internal list. These objects represent PathParameters found
within this Segment.public PathParameter getParameter(int index)
PathParameter at the given index.public List<PathParameter> getParameters()
PathParameters contained within this Segment.public int numParameters()
PathParameters contained within this Segment.public void setTemplate(String pattern)
Copyright © 2014 OCPsoft. All Rights Reserved.