@yellicode/elements
Version:
The meta model API for Yellicode - an extensible code generator.
127 lines (126 loc) • 7.71 kB
TypeScript
import * as Interfaces from "./interfaces";
import { ModelDelegate } from './model-delegate-interface';
import { ElementMap } from './element-map-interface';
import { FactoryClassMap, createdElement } from './element-factory';
/**
* Internal class to which all behaviour of the model classes is delegated.
*/
export declare class ModelDelegateImpl implements ModelDelegate {
elementMap: ElementMap | null;
private elementFactory;
constructor(elementMap: ElementMap | null);
findElementById(id: string): Interfaces.Element | null;
getFirstCommentBody(element: Interfaces.Element): string;
getTypeName(typedElement: Interfaces.TypedElement): string;
static getPackagedElementsWhere<TElement extends Interfaces.PackageableElement>(pack: Interfaces.Package, predicate: (element: Interfaces.PackageableElement) => boolean): TElement[];
private static getAllPackagedElementsWhereRecursive;
static getAllPackagedElementsWhere<TElement extends Interfaces.PackageableElement>(pack: Interfaces.Package, predicate: (element: Interfaces.PackageableElement) => boolean): TElement[];
getNestedPackages(element: Interfaces.Package): Interfaces.Package[];
getTypes(element: Interfaces.Package): Interfaces.Classifier[];
getAllTypes(element: Interfaces.Package): Interfaces.Classifier[];
getClasses(element: Interfaces.Package): Interfaces.Class[];
getAllClasses(element: Interfaces.Package): Interfaces.Class[];
getInterfaces(element: Interfaces.Package): Interfaces.Interface[];
getAllInterfaces(element: Interfaces.Package): Interfaces.Interface[];
getDataTypes(element: Interfaces.Package): Interfaces.DataType[];
getAllDataTypes(element: Interfaces.Package): Interfaces.DataType[];
getEnumerations(element: Interfaces.Package): Interfaces.Enumeration[];
getAllEnumerations(element: Interfaces.Package): Interfaces.Enumeration[];
getPackage(packagedElement: Interfaces.PackageableElement): Interfaces.Package;
/**
* Gets all packages that own this Package, working inwards from the top Package to the owning package.
* @returns {Interfaces.Package[]} A collection of Packages.
*/
getNestingPackages(packagedElement: Interfaces.PackageableElement, stopAtNamespaceRoot?: boolean): Interfaces.Package[];
getNamespaceName(packagedElement: Interfaces.PackageableElement, separator?: string): string;
getQualifiedName(packagedElement: Interfaces.PackageableElement, separator?: string): string;
getSpecific(generalization: Interfaces.Generalization): Interfaces.Classifier;
getFirstGeneralization(classifier: Interfaces.Classifier): Interfaces.Generalization | null;
getFirstParent(classifier: Interfaces.Classifier): Interfaces.Classifier | null;
getParents(classifier: Interfaces.Classifier): Interfaces.Classifier[];
/**
* Returns all of the direct and indirect ancestors of a generalized Classifier, working outwards: more specific classifiers will
* appear before more general classifiers.
*/
getAllParents(classifier: Interfaces.Classifier): Interfaces.Classifier[];
private getAllParentsRecursive;
getSpecializations(classifier: Interfaces.Classifier): Interfaces.Classifier[];
getAllSpecializations(classifier: Interfaces.Classifier): Interfaces.Classifier[];
getAllAttributes(memberedClassifier: Interfaces.MemberedClassifier): Interfaces.Property[];
private getAllAttributesRecursive;
getAllOperations(memberedClassifier: Interfaces.MemberedClassifier): Interfaces.Operation[];
private getAllOperationsRecursive;
getSuperClasses<TClass extends Interfaces.Class>(cls: TClass): TClass[];
getSuperTypes<T extends Interfaces.Classifier>(t: T): T[];
getLower(element: Interfaces.MultiplicityElement | Interfaces.Operation): number | null;
getUpper(element: Interfaces.MultiplicityElement | Interfaces.Operation): Interfaces.UnlimitedNatural | null;
getLowerBound(element: Interfaces.MultiplicityElement | Interfaces.Operation): number;
getUpperBound(element: Interfaces.MultiplicityElement | Interfaces.Operation): Interfaces.UnlimitedNatural;
isMultivalued(element: Interfaces.MultiplicityElement | Interfaces.Operation): boolean;
isOptional(element: Interfaces.MultiplicityElement | Interfaces.Operation): boolean;
isOptionalAndSinglevalued(element: Interfaces.MultiplicityElement | Interfaces.Operation): boolean;
isRequiredAndSinglevalued(element: Interfaces.MultiplicityElement | Interfaces.Operation): boolean;
getDefault(hasDefaultValue: {
defaultValue: Interfaces.ValueSpecification | null;
}): any | null;
getValue(valueSpecification: Interfaces.ValueSpecification): any | null;
getStringValue(valueSpecification: Interfaces.ValueSpecification): any | null;
getEnumeration(literal: Interfaces.EnumerationLiteral): Interfaces.Enumeration;
getSpecificationValue(literal: Interfaces.EnumerationLiteral): any | null;
getAssociation(property: Interfaces.Property): Interfaces.Association | null;
getReturnParameter(operation: Interfaces.Operation): Interfaces.Parameter | null;
getInputParameters(operation: Interfaces.Operation): Interfaces.Parameter[];
getOutputParameters(operation: Interfaces.Operation): Interfaces.Parameter[];
getReturnType(operation: Interfaces.Operation): Interfaces.Type | null;
private createValueSpecificationFromValue;
createElement<K extends keyof FactoryClassMap>(elementType: K, owner: Interfaces.Element | null, properties: any | null, initFn: ((element: createdElement<K>) => void) | null): createdElement<K>;
/**
* Notifies the delegate that a property was added as member end to an association.
*/
onMemberEndAdded(association: Interfaces.Association, end: Interfaces.Property): void;
/**
* Notifies the delegate that a generalization was added.
*/
onGeneralizationAdded(generalization: Interfaces.Generalization): void;
/**
* Notifies the delegate that a an element was added to a collection.
*/
onElementAdded(owner: Interfaces.Element, element: Interfaces.Element): void;
/**
* Notifies the delegate that a owned element was deleted from a collection.
*/
onElementDeleted(owner: Interfaces.Element, element: Interfaces.Element): void;
/**
* Sets the default value of the element to the specified value.
*/
setDefaultValue(hasDefaultValue: Interfaces.Element & {
defaultValue: Interfaces.ValueSpecification | null;
}, value: boolean | number | string): void;
/**
* Sets the default value of the element to null.
*/
setDefaultValueNull(hasDefaultValue: Interfaces.Element & {
defaultValue: Interfaces.ValueSpecification | null;
}): void;
/**
* Sets the lower value of the element to unlimited.
*/
setLowerValueUnlimited(element: Interfaces.MultiplicityElement): void;
/**
* Sets the lower value of the element to the specified integer.
*/
setLowerValue(element: Interfaces.MultiplicityElement, value: number): void;
/**
* Sets the upper value of the element to unlimited.
*/
setUpperValueUnlimited(element: Interfaces.MultiplicityElement): void;
/**
* Sets the upper value of the element to the specified integer.
*/
setUpperValue(element: Interfaces.MultiplicityElement, value: number): void;
/**
* Sets the enumeration literal to the specified value.
*/
setSpecification(element: Interfaces.EnumerationLiteral, value: number | string): void;
private static removeItems;
}