Hello. Hope you can help me.
I followed the steps in:
http://wiki.eclipse.org/Acceleo/Getting_Started#Java_services_wrappers
to define a wrapper for a Java service class.
My service class was located in the package ccc.inaoep.mx.acceleo.transformationtool.services of the Acceleo project using the wizards and its code is as follows:
package ccc.inaoep.mx.acceleo.transformationtool.services;
public class ConversionServices {
public String getBinaryFromInteger(int numberToConvert, int bitLength) {
int i;
int mask = 1;
String binaryString = "";
for (i = 1; i <= bitLength; i++)
if (i <= Integer.SIZE) {
if ((numberToConvert & mask) == 0)
binaryString = "0" + binaryString;
else
binaryString = "1" + binaryString;
mask = mask << 1;
} else {
if (numberToConvert >= 0)
binaryString = "0" + binaryString;
else
binaryString = "1" + binaryString;
}
return binaryString;
}
}
Then, I added the module file with the wrapper to the package ccc.inaoep.mx.acceleo.transformationtool.services of the Acceleo project. The code for the module (conversionservices) and the wrapper is as follows:
[comment encoding = Cp1252 /]
[module conversionservices('http://www.eclipse.org/uml2/3.0.0/UML')/]
[query public getBinaryFromInteger(arg0 : Integer, arg1 : Integer) : String
= invoke('ccc.inaoep.mx.acceleo.activity2vhdl.services.ConversionServices',
'getBinaryFromInteger(int, int)', Sequence{arg0, arg1}) /]
Then, I get the following warning attached to the invoke operation in the previous query:
The Java service class 'ccc.inaoep.mx.acceleo.transformationtool.services.ConversionServices' from the project 'ccc.inaoep.mx.acceleo.transformationtool' does not seem to have been exported.
Also, when I import ccc.inaoep.mx.acceleo.transformationtool.services.conversionservices in other module
and try to use the query getBinaryFromInteger I get the following error:
Cannot find operation (getBinaryFromInteger()) for the type (Integer)
What can I do to fix this mess? This is my first try with a service class in Acceleo. Please help.
Thanks