Elements API reference


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.


TypeNameProvider Defines 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.


DependencySortTransform Sorts 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.
ElementTypeTransform Transforms 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.
PackageFilterTransform Transforms a Model or Package by returning just the Package that matches a specified expression.
PackagedElementTransform A base class for transforms that need to be applied recursively to all nested packaged elements in a model or package.
CapitalizingTransform A transform that capitalizes its rename targets, that is, makes the first character uppercase.
LowerToUpperCamelCaseTransform A transform that converts its rename targets from lowerCamelCase to UpperCamelCase.
PrefixingTransform A transform that adds a prefix to its rename targets.
RenamingTransform A base class for renaming classes, interfaces, properties, operations parameters, enumerations and enumeration literals.
SuffixingTransform A transform that adds a suffix to its rename targets.
UnCapitalizingTransform A transform that uncapitalizes its rename targets, that is, makes the first character lowercase.
UpperToLowerCamelCaseTransform A transform that converts its rename targets from UpperCamelCase to lowerCamelCase.
DefaultTypeNameProvider Default 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.


DependencyKind A bitwise enumeration used to specify what types of dependency to include during a DependencySortTransform.
RenameTargets Enumerates which element types to be renamed when performing rename transforms.