Top Description Inners Fields Constructors Methods
org.eclipse.jetty.http.pathmap

public Class UriTemplatePathSpec

extends AbstractPathSpec
Class Inheritance
Imports
java.util.ArrayList, .Collections, .HashMap, .HashSet, .List, .Map, .Objects, .Set, java.util.regex.Matcher, .Pattern, org.eclipse.jetty.util.TypeUtil, org.slf4j.Logger, .LoggerFactory

PathSpec for URI Template based declarations
See Also
URI Templates (Level 1)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final String
private final PathSpecGroup
private final String
_logicalDeclaration

The logical (simplified) declaration

private final int
private final Pattern
private final int
private final String[]
private static final Set<String>
private static final Logger
private static final Pattern
private static final String
VARIABLE_RESERVED

Reserved Symbols in URI Template variable

private static final String
VARIABLE_SYMBOLS

Allowed Symbols in a URI Template variable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
assertIsValidVariableLiteral(String variable, String declaration)

Validate variable literal name, per RFC6570, Section 2.1 Literals

public int
compareTo(PathSpec
the object to be compared.
other
)

Overrides org.eclipse.jetty.http.pathmap.AbstractPathSpec.compareTo.

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public String
public PathSpecGroup
protected Matcher
public int
getPathDepth()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Get the number of path elements that this path spec declares.

public String
getPathInfo(String
the path to match against
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Return the portion of the path that is after the path spec.

public String
getPathMatch(String
the path to match against
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Return the portion of the path that matches a path spec.

public Map<String, String>
public Pattern
public String
getPrefix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

A simple prefix match for the pathspec or null

public int
public String
getSuffix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

A simple suffix match for the pathspec or null

public int
public String[]
private static boolean
isValidBasicLiteralCodepoint(int codepoint, String declaration)

public MatchedPath
matched(String
the path to test
path
)

Implements org.eclipse.jetty.http.pathmap.PathSpec.matched.

Get the complete matched details of the provided path.

public boolean
matches(final String
the path to test
path
)

Overrides default org.eclipse.jetty.http.pathmap.PathSpec.matches.

Test to see if the provided path matches this path spec.

Inherited from org.eclipse.jetty.http.pathmap.AbstractPathSpec:
equalshashCodetoString

Field Detail

_declarationback to summary
private final String _declaration
_groupback to summary
private final PathSpecGroup _group
_logicalDeclarationback to summary
private final String _logicalDeclaration

The logical (simplified) declaration

_pathDepthback to summary
private final int _pathDepth
_patternback to summary
private final Pattern _pattern
_specLengthback to summary
private final int _specLength
_variablesback to summary
private final String[] _variables
FORBIDDEN_SEGMENTSback to summary
private static final Set<String> FORBIDDEN_SEGMENTS
LOGback to summary
private static final Logger LOG
VARIABLE_PATTERNback to summary
private static final Pattern VARIABLE_PATTERN
VARIABLE_RESERVEDback to summary
private static final String VARIABLE_RESERVED

Reserved Symbols in URI Template variable

VARIABLE_SYMBOLSback to summary
private static final String VARIABLE_SYMBOLS

Allowed Symbols in a URI Template variable

Constructor Detail

UriTemplatePathSpecback to summary
public UriTemplatePathSpec(String rawSpec)

Method Detail

assertIsValidVariableLiteralback to summary
private static void assertIsValidVariableLiteral(String variable, String declaration)

Validate variable literal name, per RFC6570, Section 2.1 Literals

compareToback to summary
public int compareTo(PathSpec other)

Overrides org.eclipse.jetty.http.pathmap.AbstractPathSpec.compareTo.

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
other:PathSpec

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
getDeclarationback to summary
public String getDeclaration()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getDeclaration.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getDeclaration.

The as-provided path spec.

Returns:String

the as-provided path spec

Annotations
@Override
getGroupback to summary
public PathSpecGroup getGroup()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getGroup.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getGroup.

The spec group.

Returns:PathSpecGroup

the spec group.

Annotations
@Override
getMatcherback to summary
protected Matcher getMatcher(String path)
getPathDepthback to summary
public int getPathDepth()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathDepth.

Get the number of path elements that this path spec declares.

This is used to determine longest match logic.

Returns:int

the depth of the path segments that this spec declares

Annotations
@Override
getPathInfoback to summary
public String getPathInfo(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathInfo.

Return the portion of the path that is after the path spec.

Parameters
path:String

the path to match against

Returns:String

the path info portion of the string

Annotations
@Override
getPathMatchback to summary
public String getPathMatch(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPathMatch.

Return the portion of the path that matches a path spec.

Parameters
path:String

the path to match against

Returns:String

the match, or null if no match at all

Annotations
@Override
getPathParamsback to summary
public Map<String, String> getPathParams(String path)
getPatternback to summary
public Pattern getPattern()
getPrefixback to summary
public String getPrefix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getPrefix.

A simple prefix match for the pathspec or null

Returns:String

A simple prefix match for the pathspec or null

Annotations
@Override
getSpecLengthback to summary
public int getSpecLength()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSpecLength.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getSpecLength.

The length of the spec.

Returns:int

the length of the spec.

Annotations
@Override
getSuffixback to summary
public String getSuffix()

Implements org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.getSuffix.

A simple suffix match for the pathspec or null

Returns:String

A simple suffix match for the pathspec or null

Annotations
@Override
getVariableCountback to summary
public int getVariableCount()
getVariablesback to summary
public String[] getVariables()
isValidBasicLiteralCodepointback to summary
private static boolean isValidBasicLiteralCodepoint(int codepoint, String declaration)
matchedback to summary
public MatchedPath matched(String path)

Implements org.eclipse.jetty.http.pathmap.PathSpec.matched.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.matched.

Get the complete matched details of the provided path.

Parameters
path:String

the path to test

Returns:MatchedPath

the matched details, if a match was possible, or null if not able to be matched.

Annotations
@Override
matchesback to summary
public boolean matches(final String path)

Overrides default org.eclipse.jetty.http.pathmap.PathSpec.matches.

Doc from org.eclipse.jetty.http.pathmap.PathSpec.matches.

Test to see if the provided path matches this path spec. This can be more efficient that matched(String) if the details of the match are not required.

Parameters
path:String

the path to test

Returns:boolean

true if the path matches this path spec, false otherwise

Annotations
@Override
org.eclipse.jetty.http.pathmap back to summary

private Class UriTemplatePathSpec.UriTemplateMatchedPath

extends Object
implements MatchedPath
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.http.pathmap.UriTemplatePathSpec.UriTemplateMatchedPath
All Implemented Interfaces
org.eclipse.jetty.http.pathmap.MatchedPath

Field Summary

Modifier and TypeField and Description
private final Matcher
private final String
private final UriTemplatePathSpec

Constructor Summary

AccessConstructor and Description
public
UriTemplateMatchedPath(UriTemplatePathSpec uriTemplatePathSpec, String path, Matcher matcher)

Method Summary

Modifier and TypeMethod and Description
public String
getPathInfo()

Implements org.eclipse.jetty.http.pathmap.MatchedPath.getPathInfo.

Return the portion of the path that is after the path spec.

public String
getPathMatch()

Implements org.eclipse.jetty.http.pathmap.MatchedPath.getPathMatch.

Return the portion of the path that matches a path spec.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

matcherback to summary
private final Matcher matcher
pathback to summary
private final String path
pathSpecback to summary
private final UriTemplatePathSpec pathSpec

Constructor Detail

UriTemplateMatchedPathback to summary
public UriTemplateMatchedPath(UriTemplatePathSpec uriTemplatePathSpec, String path, Matcher matcher)

Method Detail

getPathInfoback to summary
public String getPathInfo()

Implements org.eclipse.jetty.http.pathmap.MatchedPath.getPathInfo.

Doc from org.eclipse.jetty.http.pathmap.MatchedPath.getPathInfo.

Return the portion of the path that is after the path spec.

Returns:String

the path info portion of the match, or null if there is no portion after the getPathMatch()

Annotations
@Override
getPathMatchback to summary
public String getPathMatch()

Implements org.eclipse.jetty.http.pathmap.MatchedPath.getPathMatch.

Doc from org.eclipse.jetty.http.pathmap.MatchedPath.getPathMatch.

Return the portion of the path that matches a path spec.

Returns:String

the path name portion of the match.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override