UNPKG

@accordproject/concerto-core

Version:

Core Implementation for the Concerto Modeling Language

68 lines (67 loc) 1.9 kB
/** * Decorator encapsulates a decorator (annotation) on a class or property. * @class * @memberof module:concerto-core */ declare class Decorator { ast: any; parent: any; arguments: any[]; name: string; /** * Create a Decorator. * @param {ClassDeclaration | Property} parent - the owner of this property * @param {Object} ast - The AST created by the parser * @throws {IllegalModelException} */ constructor(parent: any, ast: any); /** * Handles a validation error, logging and throwing as required * @param {string} level the log level * @param {*} err the error to log * @param {*} [fileLocation] the file location * @private */ handleError(level: any, err: any): void; /** * Visitor design pattern * @param {Object} visitor - the visitor * @param {Object} parameters - the parameter * @return {Object} the result of visiting or null */ accept(visitor: any, parameters: any): any; /** * Returns the owner of this property * @return {ClassDeclaration|Property} the parent class or property declaration */ getParent(): any; /** * Process the AST and build the model * @throws {IllegalModelException} * @private */ process(): void; /** * Validate the decorator * @throws {IllegalModelException} * @private */ validate(): void; /** * Returns the name of a decorator * @return {string} the name of this decorator */ getName(): string; /** * Returns the arguments for this decorator * @return {object[]} the arguments for this decorator */ getArguments(): any[]; /** * Returns true if this class is the definition of a decorator. * * @return {boolean} true if the class is a decorator */ isDecorator(): boolean; } export = Decorator;