Class Meta2ClassesTransformation
The transformation to transform an NMeta metamodel to code
public class Meta2ClassesTransformation : ReflectiveTransformation
- Inheritance
-
Meta2ClassesTransformation
- Inherited Members
Properties
DefaultNamespace
Gets or sets the default namespace for the generated code
public string DefaultNamespace { get; set; }
Property Value
Remarks
This value can only be set before the transformation is initialized
DefaultSystemImports
Gets the default imported system namespaces
public static IEnumerable<string> DefaultSystemImports { get; }
Property Value
ForceGeneration
Gets or sets a flag determing whether code should be generated regardless of existing code
public bool ForceGeneration { get; set; }
Property Value
GenerateChangedEvents
If set, for every property a corresponding event with suffix Changed is generated that gets fired when the property has changed
public bool GenerateChangedEvents { get; set; }
Property Value
GenerateChangingEvents
If set, for every property a corresponding event with suffix Changing is generated that gets fired when the property is changing
public bool GenerateChangingEvents { get; set; }
Property Value
GenerateCollectionsAsElements
If set, all collection properties are rendered as elements
public bool GenerateCollectionsAsElements { get; set; }
Property Value
GenerateForInputOnly
If set, the transformation only produces results for namespaces that have been explicitly been asked for
public bool GenerateForInputOnly { get; set; }
Property Value
NamespaceMap
Gets the namespace assigned to a model URI
public Dictionary<Uri, string> NamespaceMap { get; }
Property Value
OnlyNested
Gets or sets a value indicating whether only nested namespaces of an initial namespace should be in the code compile unit or all that are used
public bool OnlyNested { get; set; }
Property Value
Remarks
This value can only be set before the transformation is initialized
SeparateImplementations
Gets or sets a value indicating whether to separate the class implementations, i.e. create a public interface or not
public bool SeparateImplementations { get; set; }
Property Value
Remarks
This value can only be set before the transformation is initialized
SystemImports
Gets the imported system namespaces
public virtual IEnumerable<string> SystemImports { get; }
Property Value
Methods
AddToCompileUnit(INamespace)
Gets a value indicating whether the given namespace should be added to the compile unit
protected virtual bool AddToCompileUnit(INamespace n)
Parameters
Returns
CreateReference(IType, bool, ITransformationContext, bool)
Creates a reference to the given NMeta type
protected static CodeTypeReference CreateReference(IType type, bool isReference, ITransformationContext context, bool implementation = false)
Parameters
type
ITypeThe NMeta type
isReference
boolA value indicating whether to default to IModelElement or object
context
ITransformationContextThe transformation context
implementation
boolif true, a reference to the implementation is returned, otherwise a reference to the interface
Returns
- CodeTypeReference
A code type reference
GetResourceKey(Model)
Gets the resource key for the given model element
protected virtual string GetResourceKey(Model model)
Parameters
model
ModelThe model for which to generate a resource key
Returns
- string
The resource key of the model
IsValueType(IType)
Decides whether the given type is a value type
protected virtual bool IsValueType(IType type)
Parameters
type
ITypeThe NMeta type
Returns
- bool
True, if the type is represented as a value type. Override for more specifics on primitives