UNPKG

node-web-mvc

Version:
38 lines (37 loc) 1.46 kB
"use strict"; // Tip: 由于ts运行时不能保留接口定义,所以在一些需要运行进行类型判定的地方会降接口改为抽象类来定义 var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const BeanPostProcessor_1 = __importDefault(require("./BeanPostProcessor")); class InstantiationAwareBeanPostProcessor extends BeanPostProcessor_1.default { /** * 实例化bean之前执行 * @param beanClass bean类 * @param beanName 当前bean在容器中的名称 * @returns 如果返回了对象,则用于代替默认的实例对象 */ postProcessBeforeInstantiation(beanClass, beanName) { return null; } /** * 实例化bean之后执行 * @param instance bean实例对象 * @param beanName 当前bean在容器中的名称 * @returns 如果返回 false 则不进行属性设置,即不执行postProcessProperties */ postProcessAfterInstantiation(instance, beanName) { return true; } /** * 处理实例属性值 * @param pvs 属性值列表 * @param instance bean实例对象 * @param beanName 当前bean在容器中的名称 */ postProcessProperties(pvs, instance, beanName, definition) { return pvs; } } exports.default = InstantiationAwareBeanPostProcessor;