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