UNPKG

node-web-mvc

Version:
23 lines (22 loc) 933 B
"use strict"; /** * @module Autowired * @description 自动装配注解,可用于装配类的构造函数,以及属性,方法。 */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Target_1 = __importDefault(require("../../servlets/annotations/Target")); const ElementType_1 = __importDefault(require("../../servlets/annotations/annotation/ElementType")); class Autowired { constructor() { /** * 是否当前装配的实例必须存在,如果无法装配,则抛出异常 * 默认为:treu */ this.required = true; } } // 公布注解 exports.default = (0, Target_1.default)([ElementType_1.default.PROPERTY, ElementType_1.default.METHOD, ElementType_1.default.PARAMETER, ElementType_1.default.TYPE])(Autowired);