Top Description Inners Fields Constructors Methods
org.glassfish.tyrus.core.uri.internal

public final Class PathPattern

extends PatternWithGroups
Class Inheritance
Imports
java.util.Comparator

A path pattern that is a regular expression generated from a URI path template.

The path pattern is normalized by removing a terminating "/" if present.

The path pattern is post-fixed with a right hand pattern that consists of either a matching group that matches zero or more path segments, see RightHandPath#capturingZeroOrMoreSegments, or zero path segments, see RightHandPath#capturingZeroSegments.

Author
Paul Sandoz

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PathPattern.RightHandPath

The set of right hand path patterns that may be appended to a path pattern.

Field Summary

Modifier and TypeField and Description
public static final Comparator<PathPattern>
COMPARATOR

Path pattern comparator that defers to comparing the templates associated with the patterns.

public static final PathPattern
EMPTY_PATTERN

Empty path pattern matching only empty string.

public static final PathPattern
END_OF_PATH_PATTERN

Path pattern matching the end of a URI path.

public static final PathPattern
OPEN_ROOT_PATH_PATTERN

Path pattern matching the any URI path.

private final UriTemplate
Inherited from org.glassfish.tyrus.core.uri.internal.PatternWithGroups:
EMPTY

Constructor Summary

AccessConstructor and Description
private
public
PathPattern(String
the path template.
template
)

Create a path pattern and post fix with RightHandPath#capturingZeroOrMoreSegments.

public
PathPattern(PathTemplate
the path template
template
)

Create a path pattern and post fix with RightHandPath#capturingZeroOrMoreSegments.

public
PathPattern(String
the path template.
template
,
PathPattern.RightHandPath
the right hand path pattern postfix.
rhpp
)

Create a path pattern and post fix with a right hand path pattern.

public
PathPattern(PathTemplate
the path template.
template
,
PathPattern.RightHandPath
the right hand path pattern postfix.
rhpp
)

Create a path pattern and post fix with a right hand path pattern.

Method Summary

Modifier and TypeMethod and Description
private static int[]
addIndexForRightHandPathCapturingGroup(int numberOfGroups, int[] indexes)

public static PathPattern

Returns:

closed path pattern for the same path template.
asClosed
(PathPattern
an (open) path pattern to convert to a closed pattern.
pattern
)

Return a new path pattern with a same path template but a closed right hand path.

public UriTemplate
private static String
private static String
Inherited from org.glassfish.tyrus.core.uri.internal.PatternWithGroups:
equalsgetGroupIndexesgetRegexhashCodematchmatchmatchtoString

Field Detail

COMPARATORback to summary
public static final Comparator<PathPattern> COMPARATOR

Path pattern comparator that defers to comparing the templates associated with the patterns.

EMPTY_PATTERNback to summary
public static final PathPattern EMPTY_PATTERN

Empty path pattern matching only empty string.

END_OF_PATH_PATTERNback to summary
public static final PathPattern END_OF_PATH_PATTERN

Path pattern matching the end of a URI path. Can be either empty "" or contain a trailing slash "/".

OPEN_ROOT_PATH_PATTERNback to summary
public static final PathPattern OPEN_ROOT_PATH_PATTERN

Path pattern matching the any URI path.

templateback to summary
private final UriTemplate template

Constructor Detail

PathPatternback to summary
private PathPattern()
PathPatternback to summary
public PathPattern(String template)

Create a path pattern and post fix with RightHandPath#capturingZeroOrMoreSegments.

Parameters
template:String

the path template.

See Also
PathPattern(String, PathPattern.RightHandPath)
PathPatternback to summary
public PathPattern(PathTemplate template)

Create a path pattern and post fix with RightHandPath#capturingZeroOrMoreSegments.

Parameters
template:PathTemplate

the path template

See Also
PathPattern(PathTemplate, PathPattern.RightHandPath)
PathPatternback to summary
public PathPattern(String template, PathPattern.RightHandPath rhpp)

Create a path pattern and post fix with a right hand path pattern.

Parameters
template:String

the path template.

rhpp:PathPattern.RightHandPath

the right hand path pattern postfix.

PathPatternback to summary
public PathPattern(PathTemplate template, PathPattern.RightHandPath rhpp)

Create a path pattern and post fix with a right hand path pattern.

Parameters
template:PathTemplate

the path template.

rhpp:PathPattern.RightHandPath

the right hand path pattern postfix.

Method Detail

addIndexForRightHandPathCapturingGroupback to summary
private static int[] addIndexForRightHandPathCapturingGroup(int numberOfGroups, int[] indexes)
asClosedback to summary
public static PathPattern asClosed(PathPattern pattern)

Return a new path pattern with a same path template but a closed right hand path.

Parameters
pattern:PathPattern

an (open) path pattern to convert to a closed pattern.

Returns:PathPattern

closed path pattern for the same path template.

getTemplateback to summary
public UriTemplate getTemplate()
postfixWithCapturingGroupback to summary
private static String postfixWithCapturingGroup(String regex)
postfixWithCapturingGroupback to summary
private static String postfixWithCapturingGroup(String regex, PathPattern.RightHandPath rhpp)
org.glassfish.tyrus.core.uri.internal back to summary

public final Enum PathPattern.RightHandPath

extends Enum<PathPattern.RightHandPath>
Class Inheritance

The set of right hand path patterns that may be appended to a path pattern.

Field Summary

Modifier and TypeField and Description
public static final PathPattern.RightHandPath
capturingZeroOrMoreSegments

A capturing group that matches zero or more path segments and keeps the matching path template open.

public static final PathPattern.RightHandPath
capturingZeroSegments

A capturing group that matches zero segments and effectively closes the matching path template.

private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private String
public static PathPattern.RightHandPath
public static PathPattern.RightHandPath[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

capturingZeroOrMoreSegmentsback to summary
public static final PathPattern.RightHandPath capturingZeroOrMoreSegments

A capturing group that matches zero or more path segments and keeps the matching path template open.

capturingZeroSegmentsback to summary
public static final PathPattern.RightHandPath capturingZeroSegments

A capturing group that matches zero segments and effectively closes the matching path template.

regexback to summary
private final String regex

Constructor Detail

RightHandPathback to summary
private RightHandPath(String regex)

Method Detail

getRegexback to summary
private String getRegex()
valueOfback to summary
public static PathPattern.RightHandPath valueOf(String name)
valuesback to summary
public static PathPattern.RightHandPath[] values()