@yellicode/elements
Version:
The meta model API for Yellicode - an extensible code generator.
269 lines (268 loc) • 12.3 kB
JavaScript
/*
* Copyright (c) 2020 Yellicode
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* This code was generated by a tool.
*
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
*/
/**
* Contains the current version of this meta model. Note that the meta model version is independent
* from versions of packages that depend on the meta model.
*/
export var MetaVersion = '0.1.1';
/**
* Enumerates all non-abstract element types in the model. Each model element has an elementType field
* with an ElementType value.
*/
export var ElementType;
(function (ElementType) {
/**
* The element is a Association. Associations represent relationships between classes.
*/
ElementType[ElementType["association"] = 1] = "association";
/**
* Alias for ElementType.class in case the reserved 'class' is not allowed.
*/
ElementType[ElementType["_class"] = 2] = "_class";
/**
* The element is a Class. A Class classifies a set of objects and specifies the features that
* characterize the structure and behavior of those objects. A Class may have an internal structure and
* Ports.
*/
ElementType[ElementType["class"] = 2] = "class";
/**
* The element is a Comment. A Comment is a textual annotation that can be attached to a set of
* Elements.
*/
ElementType[ElementType["comment"] = 3] = "comment";
/**
* The element is a DataType. A DataType is similar to a Class; however, instances of data type are
* identified only by their value. If two data types have the same value, the instances are considered
* identical.
*/
ElementType[ElementType["dataType"] = 4] = "dataType";
/**
* The element is a Enumeration. An Enumeration is a DataType whose values are enumerated in the model
* as EnumerationLiterals.
*/
ElementType[ElementType["enumeration"] = 5] = "enumeration";
/**
* The element is a EnumerationLiteral. An EnumerationLiteral is a user-defined data value for an
* Enumeration.
*/
ElementType[ElementType["enumerationLiteral"] = 6] = "enumerationLiteral";
/**
* The element is a Generalization. A Generalization is a taxonomic relationship between a more general
* Classifier and a more specific Classifier. Each instance of the specific Classifier is also an
* instance of the general Classifier.The specific Classifier inherits the features of the more general
* Classifier. A Generalization is owned by the specific Classifier.
*/
ElementType[ElementType["generalization"] = 7] = "generalization";
/**
* Alias for ElementType.interface in case the reserved 'interface' is not allowed.
*/
ElementType[ElementType["_interface"] = 8] = "_interface";
/**
* The element is a Interface. Interfaces declare coherent services that are implemented by
* BehavioredClassifiers that implement the Interfaces via InterfaceRealizations.
*/
ElementType[ElementType["interface"] = 8] = "interface";
/**
* The element is a InterfaceRealization. An InterfaceRealization is a specialized realization
* relationship between a BehavioredClassifier and an Interface. This relationship signifies that the
* realizing BehavioredClassifier conforms to the contract specified by the Interface.
*/
ElementType[ElementType["interfaceRealization"] = 9] = "interfaceRealization";
/**
* The element is a LiteralBoolean. A LiteralBoolean is a specification of a Boolean value.
*/
ElementType[ElementType["literalBoolean"] = 10] = "literalBoolean";
/**
* The element is a LiteralInteger. A LiteralInteger is a specification of an Integer value.
*/
ElementType[ElementType["literalInteger"] = 11] = "literalInteger";
/**
* The element is a LiteralNull. A LiteralNull specifies the lack of a value.
*/
ElementType[ElementType["literalNull"] = 12] = "literalNull";
/**
* The element is a LiteralReal. A LiteralReal is a specification of a Real value.
*/
ElementType[ElementType["literalReal"] = 13] = "literalReal";
/**
* The element is a LiteralString. A LiteralString is a specification of a String value.
*/
ElementType[ElementType["literalString"] = 14] = "literalString";
/**
* The element is a LiteralUnlimitedNatural. A LiteralUnlimitedNatural is a specification of an
* UnlimitedNatural number.
*/
ElementType[ElementType["literalUnlimitedNatural"] = 15] = "literalUnlimitedNatural";
/**
* The element is a Model. Represents the top-level package.
*/
ElementType[ElementType["model"] = 16] = "model";
/**
* The element is a Operation. An Operation is a BehavioralFeature of a Classifier that specifies the
* name, type, parameters, and constraints for invoking an associated Behavior. An Operation may invoke
* both the execution of method behaviors as well as other behavioral responses.
*/
ElementType[ElementType["operation"] = 17] = "operation";
/**
* The element is a Package. A package is used to group elements, and provides a namespace for the
* grouped elements.
* A package can have one or more profile applications to indicate which profiles have been applied.
* Because a profile is a package, it is possible to apply a profile not only to packages, but also to
* profiles.
*/
ElementType[ElementType["package"] = 18] = "package";
/**
* The element is a Parameter. A Parameter is a specification of an argument used to pass information
* into or out of an invocation of a BehavioralFeature. Parameters can be treated as
* ConnectableElements within Collaborations.
*/
ElementType[ElementType["parameter"] = 19] = "parameter";
/**
* The element is a PrimitiveType. A PrimitiveType defines a predefined DataType, without any
* substructure. A PrimitiveType may have an algebra and operations defined outside of UML, for
* example, mathematically.
*/
ElementType[ElementType["primitiveType"] = 20] = "primitiveType";
/**
* The element is a Profile. Metamodel customizations are defined in a profile, which is then applied
* to a package. A profile can define classes, stereotypes, data types, primitive types, enumerations.
* Stereotypes are specific metaclasses, tagged values are standard metaattributes, and profiles are
* specific kinds of packages.
*/
ElementType[ElementType["profile"] = 21] = "profile";
/**
* The element is a Property. A Property is a StructuralFeature. A Property related by ownedAttribute
* to a Classifier (other than an association) represents an attribute and might also represent an
* association end. It relates an instance of the Classifier to a value or set of values of the type of
* the attribute. A Property related by memberEnd to an Association represents an end of the
* Association. The type of the Property is the type of the end of the Association.
*/
ElementType[ElementType["property"] = 22] = "property";
/**
* The element is a Stereotype. Stereotype is a profile class which defines how an existing metaclass
* may be extended as part of a profile. It enables the use of a platform or domain specific
* terminology or notation in place of, or in addition to, the ones used for the extended metaclass.
*/
ElementType[ElementType["stereotype"] = 23] = "stereotype";
})(ElementType || (ElementType = {}));
/**
* UnlimitedNatural is a primitive type representing unlimited natural values.
*/
var UnlimitedNatural = /** @class */ (function () {
function UnlimitedNatural(value) {
/**
* Contains the known numeric value of this UnlimitedNatural. This is only a valid value if IsInfinity is false.
*/
this.Value = null;
if (typeof value == 'string') {
if (value === "*")
this.IsInfinity = true;
else {
this.IsInfinity = false;
this.Value = Number.parseInt(value);
}
}
else { // value is a number
this.IsInfinity = false;
this.Value = value;
}
}
UnlimitedNatural.prototype.stringValue = function () {
if (this.IsInfinity)
return "*";
return this.Value ? this.Value.toString() : null;
};
UnlimitedNatural.prototype.equals = function (other) {
return (other != null)
&& (other.IsInfinity == this.IsInfinity)
&& (other.Value === this.Value);
};
return UnlimitedNatural;
}());
export { UnlimitedNatural };
/**
* VisibilityKind is an enumeration type that defines literals to determine the visibility of Elements
* in a model.
*/
export var VisibilityKind;
(function (VisibilityKind) {
/**
* A Named Element with public visibility is visible to all elements that can access the contents of
* the Namespace that owns it.
*/
VisibilityKind[VisibilityKind["public"] = 1] = "public";
/**
* A NamedElement with private visibility is only visible inside the Namespace that owns it.
*/
VisibilityKind[VisibilityKind["private"] = 2] = "private";
/**
* A NamedElement with protected visibility is visible to Elements that have a generalization
* relationship to the Namespace that owns it.
*/
VisibilityKind[VisibilityKind["protected"] = 3] = "protected";
/**
* A NamedElement with package visibility is visible to all Elements within the nearest enclosing
* Package (given that other owning Elements have proper visibility). Outside the nearest enclosing
* Package, a NamedElement marked as having package visibility is not visible. Only NamedElements that
* are not owned by Packages can be marked as having package visibility.
*/
VisibilityKind[VisibilityKind["package"] = 4] = "package";
})(VisibilityKind || (VisibilityKind = {}));
/**
* ParameterDirectionKind is an Enumeration that defines literals used to specify direction of
* parameters.
*/
export var ParameterDirectionKind;
(function (ParameterDirectionKind) {
/**
* Indicates that Parameter values are passed in by the caller.
*/
ParameterDirectionKind[ParameterDirectionKind["in"] = 1] = "in";
/**
* Indicates that Parameter values are passed in by the caller and (possibly different) values passed
* out to the caller.
*/
ParameterDirectionKind[ParameterDirectionKind["inout"] = 2] = "inout";
/**
* Indicates that Parameter values are passed out to the caller.
*/
ParameterDirectionKind[ParameterDirectionKind["out"] = 3] = "out";
/**
* Indicates that Parameter values are passed as return values back to the caller.
*/
ParameterDirectionKind[ParameterDirectionKind["return"] = 4] = "return";
})(ParameterDirectionKind || (ParameterDirectionKind = {}));
export var DocumentLocationKind;
(function (DocumentLocationKind) {
DocumentLocationKind[DocumentLocationKind["local"] = 1] = "local";
DocumentLocationKind[DocumentLocationKind["npm"] = 2] = "npm";
})(DocumentLocationKind || (DocumentLocationKind = {}));
/**
* AggregationKind is an Enumeration for specifying the kind of aggregation of a Property.
*/
export var AggregationKind;
(function (AggregationKind) {
/**
* Indicates that the Property has no aggregation.
*/
AggregationKind[AggregationKind["none"] = 1] = "none";
/**
* Indicates that the Property has shared aggregation.
*/
AggregationKind[AggregationKind["shared"] = 2] = "shared";
/**
* Indicates that the Property is aggregated compositely, i.e., the composite object has responsibility
* for the existence and storage of the composed objects (parts).
*/
AggregationKind[AggregationKind["composite"] = 3] = "composite";
})(AggregationKind || (AggregationKind = {}));