AntPatternNamespace

class AntPatternNamespace @JvmOverloads constructor(pattern: String, val rawPathVariables: Set<String> = emptySet()) : Namespace(source)

An implementation of Namespace that matches subjects based on Ant style path patterns.

This supports the majority of the rules laid out in Spring's AntPathMatcher, but with the exception that regex path variables are not supported.

Simple path variables such as {client} are supported, and can be accessed via extractPathVariables.

Constructors

Link copied to clipboard
constructor(pattern: String, rawPathVariables: Set<String> = emptySet())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class ObjectMap(val fromPattern: String, val toPattern: String)

Represents a mapping between a from-pattern and a to-pattern, used for injecting user-specific information into subjects requested by Liberator.

Properties

Link copied to clipboard

Indicates whether this pattern only matches one exact path (i.e. no use of ?, *, ** or path variables).

Link copied to clipboard

Provides a list of possible path variables.

Link copied to clipboard

The Ant-style path pattern used by this namespace.

Link copied to clipboard

Provides a POSIX Extended Regular Expression version of this pattern, suitable for use in Service.addIncludePattern and Service.addExcludePattern

Link copied to clipboard

Path variable names whose values are returned unchanged by extractPathVariables instead of being URL-decoded. Intended for values injected by Liberator (such as usernames mapped from %u/%U) that are not URL-encoded. Empty by default.

Functions

Link copied to clipboard
fun copy(rawPathVariables: Set<String> = this.rawPathVariables): AntPatternNamespace

Returns a copy of this namespace with rawPathVariables replaced.

Link copied to clipboard

Splits the path portion of a subject into its URL-decoded segments, in order. Any trailing ?query is ignored.

Link copied to clipboard

Extracts path variables from a matching subject. Values are URL-decoded, except for any listed in rawPathVariables which are returned verbatim. Any trailing ?query is ignored, so a subject that carries query parameters yields the same path variables as the query-less subject.

Link copied to clipboard

Extracts the query parameters from the optional trailing ?a=b&c=d portion of a subject.

Link copied to clipboard

Creates from and to object-map patterns that can be used with Service.addObjectMap to inject user-specific information into subjects requested by Liberator.

Link copied to clipboard
open override fun match(path: String): Boolean
Link copied to clipboard
open override fun toString(): String