I am newbie in Java, I am trying to adjust the output classes generated by JASN1 OpenMUC compiler (for java 1.5+) to run it on a BGS5 CLDC 1.1 platform. Most basic classes have been altered and compiled successfully but there remains an issue regarding the using of parametrised List or collection class. It is used on one of basic class and used severely in most of the produced classes. and it is not supported by the CLDC 1.1 device's java libraries.
My question has two branches:
- Is there any way to do the source translation from standard java to the J2ME?
- How can I replace the parametrised List in the source code by a basic supported class like Vector.
A sample of a targeted class containing the parametrised List member is:
//This class file was automatically generated by jASN1 v1.6.0 (http://www.openmuc.org)
package MyPackage;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
// those packages are not available
public class DeviceInputOutputStatus {
public List<IOStatus> seqOf = null;
//IOStatus is a class of the package
public DeviceInputOutputStatus () {
seqOf = new ArrayList<IOStatus>();
}
public int encode(BerByteArrayOutputStream os) throws IOException
{
int codeLength = 0;
for (int i = (seqOf.size() - 1); i >= 0; i--) {
codeLength += seqOf.get(i).encode(os, true);
//encode is a method of IOStatus
}
return codeLength;
}
}