Elements API reference

Overview

This reference describes the utility types that are part of the @yellicode/elements package. Currently, these types are mainly model transforms that can be used to transform Yellicode models when in a code generation template.

The @yellicode/elements package also contains the meta model API that is used to navigate Yellicode models. The meta model API is documented in a separate Model API reference.

Interfaces

TypeNameProviderDefines the interface for classes that determine type names for types in a model. This interface is typically implemented by language-specific code generators, which may need to convert the name of a model type to the name used by the programming lanugage. For example: a decimal, float or integer in a model should result in a type named 'number' when generating TypeScript code. This interface is implemented by the DefaultTypeNameProvider, which can be extended to provide language-specific type names.

Classes

DependencySortTransformSorts the types within a package (and within each nested package) based on their dependencies, in such a way that dependencies appear before dependents. Dependencies are determined based on generalizations, interface realizations, attributes and operation parameters.
ElementTypeTransformTransforms packageable element elements of one element type to another element type. For example, this transform lets you transform all classes in a model or package to interfaces.
PackageFilterTransformTransforms a Model or Package by returning just the Package that matches a specified expression.
PackagedElementTransformA base class for transforms that need to be applied recursively to all nested packaged elements in a model or package.
CapitalizingTransformA transform that capitalizes its rename targets, that is, makes the first character uppercase.
LowerToUpperCamelCaseTransformA transform that converts its rename targets from lowerCamelCase to UpperCamelCase.
PrefixingTransformA transform that adds a prefix to its rename targets.
RenamingTransformA base class for renaming classes, interfaces, properties, operations parameters, enumerations and enumeration literals.
SuffixingTransformA transform that adds a suffix to its rename targets.
UnCapitalizingTransformA transform that uncapitalizes its rename targets, that is, makes the first character lowercase.
UpperToLowerCamelCaseTransformA transform that converts its rename targets from UpperCamelCase to lowerCamelCase.
DefaultTypeNameProviderDefault implementation of the TypeNameProvider interface. This implementation returns type names as-is, but allows inheritors to provide their own implementation by overriding getTypeNameForType and/or getTypeNameForTypedElement.

Enumerations

DependencyKindA bitwise enumeration used to specify what types of dependency to include during a DependencySortTransform.
RenameTargetsEnumerates which element types to be renamed when performing rename transforms.