Class Meta2ClassesTransformation.Attribute2Property
The transformation rule to transform attributes of a class or extension to a code property
public class Meta2ClassesTransformation.Attribute2Property : TransformationRule<IAttribute, CodeMemberProperty>
- Inheritance
-
Meta2ClassesTransformation.Attribute2Property
- Inherited Members
Methods
CreateBagImplementationType(CodeTypeReference)
Creates the bag implementation of the given element type reference
protected virtual CodeTypeReference CreateBagImplementationType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe type reference of the bags elements
Returns
- CodeTypeReference
A type reference for the bag implementation for the given element type
CreateBagInterfaceType(CodeTypeReference)
Creates the bag interface type for the given element type
protected virtual CodeTypeReference CreateBagInterfaceType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe element type
Returns
- CodeTypeReference
The bag interface type reference, by default the generic ICollection
CreateDefaultValue(IAttribute, CodeTypeReference, CodeMemberProperty)
Creates the default value for the property
protected virtual CodeExpression CreateDefaultValue(IAttribute input, CodeTypeReference fieldType, CodeMemberProperty generatedProperty)
Parameters
input
IAttributeThe input NMeta attribute
fieldType
CodeTypeReferenceThe code type reference for the field type
generatedProperty
CodeMemberPropertyThe generated property
Returns
- CodeExpression
A code expression that represents the default value
CreateListImplementationType(CodeTypeReference)
Creates the list implementation of the given element type reference
protected virtual CodeTypeReference CreateListImplementationType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe type reference of the lists elements
Returns
- CodeTypeReference
A type reference for the list implementation for the given element type
CreateListInterfaceType(CodeTypeReference)
Creates the list interface type for the given element type
protected virtual CodeTypeReference CreateListInterfaceType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe element type
Returns
- CodeTypeReference
The list interface type reference, by default the generic IList
CreateOrderedSetImplementationType(CodeTypeReference)
Creates the ordered set implementation of the given element type reference
protected virtual CodeTypeReference CreateOrderedSetImplementationType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe type reference of the elements
Returns
- CodeTypeReference
A type reference for the ordered set implementation for the given element type
CreateOrderedSetInterfaceType(CodeTypeReference)
Creates the ordered set interface type for the given element type
protected virtual CodeTypeReference CreateOrderedSetInterfaceType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe element type reference
Returns
- CodeTypeReference
The ordered set interface type, by default the generic IOrderedSet interface from NMF.Collections.Generic
CreateOutput(IAttribute, ITransformationContext)
Creates the output of this transformation rule
public override CodeMemberProperty CreateOutput(IAttribute input, ITransformationContext context)
Parameters
input
IAttributeThe input of the transformation rule
context
ITransformationContextThe context (and trace!) object
Returns
- CodeMemberProperty
The output for this transformation under this input
Remarks
At this point, not all of the computations have created their output and thus, the trace is not complete. Use the OutputDelayLevel-feature to have the trace contain all elements created in earlier levels
CreateSetImplementationType(CodeTypeReference)
Creates the unordered set implementation of the given element type reference
protected virtual CodeTypeReference CreateSetImplementationType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe elements type reference
Returns
- CodeTypeReference
A type reference for the unordered set implementation for the given element type
CreateSetInterfaceType(CodeTypeReference)
Creates the unordered set interface type for the given element type
protected virtual CodeTypeReference CreateSetInterfaceType(CodeTypeReference elementTypeReference)
Parameters
elementTypeReference
CodeTypeReferenceThe element type reference
Returns
- CodeTypeReference
The unordered set interface type, by default the generic ISet
RegisterDependencies()
Registers the dependency to generate refibed attributes
public override void RegisterDependencies()
Transform(IAttribute, CodeMemberProperty, ITransformationContext)
Initializes the generated property
public override void Transform(IAttribute input, CodeMemberProperty generatedProperty, ITransformationContext context)
Parameters
input
IAttributeThe input NMeta attribute
generatedProperty
CodeMemberPropertyThe generated property
context
ITransformationContextThe transformation context