UNPKG

node-web-mvc

Version:
39 lines (38 loc) 1.27 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); /** * @module PathMatchConfigurer * @description 路径匹配配置,可配置servlet路径解析,以及资源url解析 */ const PathMatcher_1 = __importDefault(require("../util/PathMatcher")); const UrlPathHelper_1 = __importDefault(require("../util/UrlPathHelper")); class PathMatchConfigurer { setUrlPathHelper(helper) { this.urlPathHelper = helper; } setPathMatcher(matcher) { this.pathMatcher = matcher; } getPathMatcherOrDefault() { if (this.pathMatcher) { return this.pathMatcher; } if (!this.defaultPathMatcher) { this.defaultPathMatcher = new PathMatcher_1.default(); } return this.defaultPathMatcher; } getUrlPathHelperOrDefault() { if (this.urlPathHelper) { return this.urlPathHelper; } if (!this.defaultUrlPathHelper) { this.defaultUrlPathHelper = new UrlPathHelper_1.default(); } return this.defaultUrlPathHelper; } } exports.default = PathMatchConfigurer;