Module: Muml_DataType

Defined in:
lib/ontomde-uml2-java/java.rb

Instance Method Summary collapse

Instance Method Details

#java_qualifiedNameObject

returns datatype qualified name.

NOTE:

  • A predefined mapping is defined UML_TO_JAVA_PRIMTIVE_TYPE_MAPPING

  • MagicDraw handles primtive types as DataType

  • RSM handles primtive types as PrimitiveType



1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
# File 'lib/ontomde-uml2-java/java.rb', line 1146

def java_qualifiedName
  return super if kind_of?(Muml_Enumeration)

  return JavaMapping.instance.getTemplate(self).getJavaType


  ot=uml_name_one
  mt=::Muml_PrimitiveType::UML_TO_JAVA_PRIMITIVE_TYPE_MAPPING[ot]
  return mt unless mt.nil? || mt.to_s==""
  #avoid multiple messages
  ::Muml_PrimitiveType::UML_TO_JAVA_PRIMITIVE_TYPE_MAPPING[ot]="String"
  log.error %{
WARN: A default java mapping has been created for DataType #{ot}
HELP:
HELP: To declare a new mapping, create a new entry as shown bellow:
HELP: module Muml_DataType
HELP:  UML_TO_JAVA_PRIMITIVE_TYPE_MAPPING["#{ot}"]="your target java type"
HELP: end
  } #(not useful here) unless log_already_displayed?("#{rdf_uri}__datatype")
  return java_qualifiedName # retry
end