Class: UML13EAToUML13

Inherits:
RGen::Transformer show all
Includes:
UML13EA
Defined in:
lib/ea_support/uml13_ea_to_uml13.rb

Constant Summary

Constants included from UML13EA

UML13EA::AggregationKind, UML13EA::CallConcurrencyKind, UML13EA::ChangeableKind, UML13EA::MessageDirectionKind, UML13EA::OperationDirectionKind, UML13EA::OrderingKind, UML13EA::ParameterDirectionKind, UML13EA::PseudostateKind, UML13EA::ScopeKind, UML13EA::VisibilityKind

Constants included from RGen::MetamodelBuilder::DataTypes

RGen::MetamodelBuilder::DataTypes::Boolean

Instance Method Summary collapse

Methods included from RGen::MetamodelBuilder::ModuleExtension

#_annotations, #_constantOrder, #annotation, extended, #final_method, #method_added

Methods included from RGen::ECore::ECoreInterface

#_set_ecore_internal, clear_ecore_cache, #ecore

Methods inherited from RGen::Transformer

_methods, #_transformProperties, _transformer_blocks, copy, copy_all, #copy_features, #initialize, method, #method_missing, #trans, transform

Constructor Details

This class inherits a constructor from RGen::Transformer

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RGen::Transformer

Instance Method Details

#cleanModelObject



17
18
19
20
21
# File 'lib/ea_support/uml13_ea_to_uml13.rb', line 17

def cleanModel
  @env_out.find(:class => UML13::ModelElement).each do |me|
    me.taggedValue = []
  end
end

#copyAssociationEndObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ea_support/uml13_ea_to_uml13.rb', line 43

def copyAssociationEnd
  copy_features :except => [:isOrdered, :changeable] do
    {:ordering => isOrdered ? :ordered : :unordered,
     :changeability => {:none => :frozen}[changeable] || changeable,
     :aggregation => {:shared => :aggregate}[aggregation] || aggregation,
     :multiplicity => UML13::Multiplicity.new(
      :range => [UML13::MultiplicityRange.new(
        :lower => multiplicity && multiplicity.split("..").first,
        :upper => multiplicity && multiplicity.split("..").last)])}
  end
end

#transformObject



8
9
10
11
12
13
14
15
# File 'lib/ea_support/uml13_ea_to_uml13.rb', line 8

def transform
  trans(:class => Package)
  trans(:class => Class)
  @env_out.find(:class => UML13::Attribute).each do |me|
    # remove tagged vales internally used by EA which have been converted to UML
    me.taggedValue = me.taggedValue.reject{|tv| ["lowerBound", "upperBound"].include?(tv.tag)}
  end
end