接口 PathContainer
- 所有已知子接口:
RequestPath
public interface PathContainer
Structured representation of a URI path parsed viaparsePath(String)
into a sequence ofPathContainer.Separator
andPathContainer.PathSegment
elements.Each
PathContainer.PathSegment
exposes its content in decoded form and with path parameters removed. This makes it safe to match one path segment at a time without the risk of decoded reserved characters altering the structure of the path.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interface
PathContainer.Element
A path element, either separator or path segment.static class
PathContainer.Options
Options to customize parsing based on the type of input path.static interface
PathContainer.PathSegment
Path segment element.static interface
PathContainer.Separator
Path separator element.
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 List<PathContainer.Element>
elements()
The contained path elements, eitherPathContainer.Separator
orPathContainer.PathSegment
.static PathContainer
parsePath(String path)
static PathContainer
parsePath(String path, PathContainer.Options options)
Parse the path value into a sequence ofSeparator
andPathSegment
elements.default PathContainer
subPath(int index)
Extract a sub-path from the given offset into the elements list.default PathContainer
subPath(int startIndex, int endIndex)
Extract a sub-path from the given start offset into the element list (inclusive) and to the end offset (exclusive).String
value()
The original path from which this instance was parsed.
方法详细资料
elements
List<PathContainer.Element> elements()
The contained path elements, eitherPathContainer.Separator
orPathContainer.PathSegment
.
subPath
default PathContainer subPath(int index)
Extract a sub-path from the given offset into the elements list.- 参数:
index
- the start element index (inclusive)- 返回:
- the sub-path
subPath
default PathContainer subPath(int startIndex, int endIndex)
Extract a sub-path from the given start offset into the element list (inclusive) and to the end offset (exclusive).- 参数:
startIndex
- the start element index (inclusive)endIndex
- the end element index (exclusive)- 返回:
- the sub-path
parsePath
static PathContainer parsePath(String path)
- 参数:
path
- the encoded, raw path value to parse- 返回:
- the parsed path
parsePath
static PathContainer parsePath(String path, PathContainer.Options options)
Parse the path value into a sequence ofSeparator
andPathSegment
elements.- 参数:
path
- the encoded, raw path value to parseoptions
- to customize parsing- 返回:
- the parsed path
- 从以下版本开始:
- 5.2