UNPKG

@accordproject/concerto-core

Version:

Core Implementation for the Concerto Modeling Language

67 lines (59 loc) 1.84 kB
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; const Property = require('./property'); // Types needed for TypeScript generation. /* eslint-disable no-unused-vars */ /* istanbul ignore next */ if (global === undefined) { const ClassDeclaration = require('./classdeclaration'); } /* eslint-enable no-unused-vars */ /** * Class representing a value from a set of enumerated values * * @extends Property * @see See {@link Property} * @class * @memberof module:concerto-core */ class EnumValueDeclaration extends Property { /** * Create a EnumValueDeclaration. * @param {ClassDeclaration} parent - The owner of this property * @param {Object} ast - The AST created by the parser * @throws {IllegalModelException} */ constructor(parent, ast) { super(parent, ast); } /** * Validate the property * @param {ClassDeclaration} classDecl the class declaration of the property * @throws {IllegalModelException} * @private */ validate(classDecl) { super.validate(classDecl); } /** * Returns true if this class is the definition of a enum value. * * @return {boolean} true if the class is an enum value */ isEnumValue() { return true; } } module.exports = EnumValueDeclaration;