接口 PathContainer
- 所有已知子接口:
RequestPath
public interface PathContainer
Structured representation of a URI path parsed viaparsePath(String)into a sequence ofPathContainer.SeparatorandPathContainer.PathSegmentelements.Each
PathContainer.PathSegmentexposes 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 interfacePathContainer.ElementA path element, either separator or path segment.static classPathContainer.OptionsOptions to customize parsing based on the type of input path.static interfacePathContainer.PathSegmentPath segment element.static interfacePathContainer.SeparatorPath separator element.
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 List<PathContainer.Element>elements()The contained path elements, eitherPathContainer.SeparatororPathContainer.PathSegment.static PathContainerparsePath(String path)static PathContainerparsePath(String path, PathContainer.Options options)Parse the path value into a sequence ofSeparatorandPathSegmentelements.default PathContainersubPath(int index)Extract a sub-path from the given offset into the elements list.default PathContainersubPath(int startIndex, int endIndex)Extract a sub-path from the given start offset into the element list (inclusive) and to the end offset (exclusive).Stringvalue()The original path from which this instance was parsed.
方法详细资料
elements
List<PathContainer.Element> elements()
The contained path elements, eitherPathContainer.SeparatororPathContainer.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 ofSeparatorandPathSegmentelements.- 参数:
path- the encoded, raw path value to parseoptions- to customize parsing- 返回:
- the parsed path
- 从以下版本开始:
- 5.2