import {supplier} from "../Interface"; import {DecoratorImpl} from "./DecoratorImpl"; import {affectFn, DecoratorSink, propertiesDescriptor} from "./DecoratorInterfaces"; export abstract class AbstractDecorator implements DecoratorSink{ /*** * */ protected abstract prop: propertiesDescriptor; /*** * */ protected abstract decorator:string; /*** * */ protected name:string; /*** * */ protected propertyKey:supplier; /*** * */ protected constructor() {} /*** * */ public affect: affectFn = ():void =>void 0; /*** * */ public get(): propertiesDescriptor {return this.prop;} /*** * */ public setProp(prop:propertiesDescriptor):void{ this.prop = prop===null||prop===undefined? new DecoratorImpl.AttributesDescriptor() : prop; } public setName(value: string):void{this.name=value; } /*** * */ public getName():string{ return this.name; } /*** * */ public getPropertyKey():string{ return !this.propertyKey ? this.name : this.propertyKey.get(); } /*** * */ public setProperty(supplier: supplier):void{ this.propertyKey=supplier; } /*** * */ public getDecorator():string{ return this.decorator||"ANNOTATION"; } /***@ts-ignore*/ public setDecorator(value:string):DecoratorSink{ this.decorator=value; return this;} }