// Compile code that initializes the static _sortOrder
LocalVariableGen sortOrderTemp
= methodGen.addLocalVariable("sort_order_tmp",
Util.getJCRefType("[" + STRING_SIG),
null, null);
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateSortOrder(classGen, methodGen);
il.append(AASTORE);
}
sortOrderTemp.setStart(il.append(new ASTORE(sortOrderTemp.getIndex())));
LocalVariableGen sortTypeTemp
= methodGen.addLocalVariable("sort_type_tmp",
Util.getJCRefType("[" + STRING_SIG),
null, null);
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateSortType(classGen, methodGen);
il.append(AASTORE);
}
sortTypeTemp.setStart(il.append(new ASTORE(sortTypeTemp.getIndex())));
LocalVariableGen sortLangTemp
= methodGen.addLocalVariable("sort_lang_tmp",
Util.getJCRefType("[" + STRING_SIG),
null, null);
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateLang(classGen, methodGen);
il.append(AASTORE);
}
sortLangTemp.setStart(il.append(new ASTORE(sortLangTemp.getIndex())));
LocalVariableGen sortCaseOrderTemp
= methodGen.addLocalVariable("sort_case_order_tmp",
Util.getJCRefType("[" + STRING_SIG),
null, null);
il.append(new PUSH(cpg, nsorts));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
for (int level = 0; level < nsorts; level++) {
final Sort sort = (Sort)sortObjects.elementAt(level);
il.append(DUP);
il.append(new PUSH(cpg, level));
sort.translateCaseOrder(classGen, methodGen);
il.append(AASTORE);
}
sortCaseOrderTemp.setStart(
il.append(new ASTORE(sortCaseOrderTemp.getIndex())));
il.append(new NEW(cpg.addClass(sortRecordFactoryClass)));
il.append(DUP);
il.append(methodGen.loadDOM());
il.append(new PUSH(cpg, sortRecordClass));
il.append(classGen.loadTranslet());
sortOrderTemp.setEnd(il.append(new ALOAD(sortOrderTemp.getIndex())));
sortTypeTemp.setEnd(il.append(new ALOAD(sortTypeTemp.getIndex())));
sortLangTemp.setEnd(il.append(new ALOAD(sortLangTemp.getIndex())));