Module: Muml_Operation

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

Instance Method Summary collapse

Instance Method Details

#as_NameObject

Hack



120
121
122
123
124
125
126
127
128
129
# File 'lib/ontomde-uml2-flex/main.rb', line 120

def as_Name
	s=super
	if  !self.as_getter_property.empty?
		return "get #{s[3,s.length]}"
	end
	if  !self.as_setter_property.empty?
		return "set #{s[3,s.length]}"
	end
	return s
end

#as_writeObject



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/ontomde-uml2-flex/main.rb', line 131

def as_write
	#TODO: decide what to do with functions in actionscript
	#write("\/\/IGNORED: function #{as_Name}\n")
	#return

	write("\n")
	as_writeAnnotation
	as_writeMethodModifiers
	write("function ");

	if umlx_isConstructor?
		write("#{umlx_class_one.as_Name}")
	else
		write("#{as_Name}")
	end
	as_writeMethodParameters
	as_writeMethodThrows


	as_writeMethodReturnType unless umlx_isConstructor?

	as_writeMethodBody
end

#as_writeMethodBodyNotImplementedObject

writes default code for a method not implemented



175
176
177
178
179
180
181
182
# File 'lib/ontomde-uml2-flex/main.rb', line 175

def as_writeMethodBodyNotImplemented
	write <<END
{
 //TODO: implement method body
 throw new Error("[operation \\"#{as_Name}\\"not implemented]");
}
END
end

#as_writeParameterType(fp) ⇒ Object

write java type parameter (without the name)

Example:

  • void

  • int

  • pack1.Class1



161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/ontomde-uml2-flex/main.rb', line 161

def as_writeParameterType(fp)
	if (fp.nil?)
		# fp.write("void ");
	else
		write(" : ")
		fp.as_write
		#uml_isException (!! a ne pas confondre avec une exception)
		#uml_isOrdered
		#uml_isStream
		#uml_isUnique
	end
end