UNPKG

@accordproject/concerto-core

Version:

Core Implementation for the Concerto Modeling Language

61 lines (60 loc) 1.85 kB
import Property = require('./property'); /** * Class representing the definition of a Field. A Field is owned * by a ClassDeclaration and has a name, type and additional metadata * (see below). * @private * @extends Property * @see See {@link Property} * @class * @memberof module:concerto-core */ declare class Field extends Property { /** * Create a Field. * @param {ClassDeclaration} parent - The owner of this property * @param {Object} ast - The AST created by the parser * @throws {IllegalModelException} */ constructor(parent: any, ast: any); /** * Process the AST and build the model * @throws {IllegalModelException} * @private */ process(): void; /** * Returns the validator string for this field * @return {Validator} the validator for the field or null */ getValidator(): any; /** * Returns the default value for the field or null if there is no default value * @return {string | number} the default value for the field or null */ getDefaultValue(): any; /** * Returns a string representation of this property§ * @return {String} the string version of the property. */ toString(): string; /** * Returns true if this class is the definition of a field. * * @return {boolean} true if the class is a field */ isField(): boolean; /** * Returns true if the field's type is a scalar * @returns {boolean} true if the field is a scalar type */ isTypeScalar(): any; /** * Unboxes a field that references a scalar type to an * underlying Field definition. * @throws {Error} throws an error if this field is not a scalar type. * @returns {Field} the primitive field for this scalar */ getScalarField(): any; } export = Field;