Module: Muml_Enumeration

Defined in:
lib/ontomde-uml2-flex/main.rb

Instance Method Summary collapse

Instance Method Details

#as_writeClassBodyObject

write enum body (list of litterals) using as_writeClassComment, as_writeClassModifiers, as_writeMetaClassName.

Example:

  • { red,blue,green }



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/ontomde-uml2-flex/main.rb', line 270

def as_writeClassBody
	as_writeClassComment
	as_writeAnnotation
	as_writeClassModifiers
	as_writeMetaClassName
	write("\n{\n")
	uml_ownedLiteral.each {|c|
		write(%{public static var #{c}:#{as_Name} = new EtatDossier("#{c}");\n})
	}
	write <<END

public function #{as_Name}(str:String){
  name=str;
}

public static function getValues():ArrayCollection{
  var values:ArrayCollection = new ArrayCollection();
END
uml_ownedLiteral.each {|c|
write("   values.addItem(#{c});\n");
}
write <<END
  return values;
}

public function toString(){
  return name;
  }
END

	#as_writeDeclarationSpecificOnBegin
	as_writeAttributes
	write("\n\n")
	#as_writeConstructors
	write("\n\n")
	as_writeOperations
	#as_writeDeclarationSpecificOnEnd



	write("\n}");
end