staticConst.markChunkEnd();
}
staticConst.markChunkStart();
il.append(new PUSH(cpg, size));
il.append(new NEWARRAY(BasicType.INT));
int typesArrayRef = cpg.addFieldref(_className,
STATIC_TYPES_ARRAY_FIELD,
TYPES_INDEX_SIG);
il.append(new PUTSTATIC(typesArrayRef));
staticConst.markChunkEnd();
for (int i = 0; i < size; i++) {
final int nodeType = typesArray[i];
staticConst.markChunkStart();
il.append(new GETSTATIC(typesArrayRef));
il.append(new PUSH(cpg, i));
il.append(new PUSH(cpg, nodeType));
il.append(IASTORE);
staticConst.markChunkEnd();
}
// Put the namespace names array into the translet
final Vector namespaces = getXSLTC().getNamespaceIndex();
staticConst.markChunkStart();
il.append(new PUSH(cpg, namespaces.size()));
il.append(new ANEWARRAY(cpg.addClass(STRING)));
int namespaceArrayRef = cpg.addFieldref(_className,
STATIC_NAMESPACE_ARRAY_FIELD,
NAMESPACE_INDEX_SIG);
il.append(new PUTSTATIC(namespaceArrayRef));
staticConst.markChunkEnd();
for (int i = 0; i < namespaces.size(); i++) {
final String ns = (String)namespaces.elementAt(i);
staticConst.markChunkStart();
il.append(new GETSTATIC(namespaceArrayRef));
il.append(new PUSH(cpg, i));
il.append(new PUSH(cpg, ns));
il.append(AASTORE);
staticConst.markChunkEnd();
}
// Put the tree of stylesheet namespace declarations into the translet
final Vector namespaceAncestors = getXSLTC().getNSAncestorPointers();
if (namespaceAncestors != null && namespaceAncestors.size() != 0) {
addStaticField(classGen, NS_ANCESTORS_INDEX_SIG,
STATIC_NS_ANCESTORS_ARRAY_FIELD);
staticConst.markChunkStart();
il.append(new PUSH(cpg, namespaceAncestors.size()));
il.append(new NEWARRAY(BasicType.INT));
int namespaceAncestorsArrayRef =
cpg.addFieldref(_className, STATIC_NS_ANCESTORS_ARRAY_FIELD,
NS_ANCESTORS_INDEX_SIG);
il.append(new PUTSTATIC(namespaceAncestorsArrayRef));
staticConst.markChunkEnd();
for (int i = 0; i < namespaceAncestors.size(); i++) {
int ancestor = ((Integer) namespaceAncestors.get(i)).intValue();
staticConst.markChunkStart();
il.append(new GETSTATIC(namespaceAncestorsArrayRef));
il.append(new PUSH(cpg, i));
il.append(new PUSH(cpg, ancestor));
il.append(IASTORE);
staticConst.markChunkEnd();
}
}
// Put the array of indices into the namespace prefix/URI pairs array
// into the translet
final Vector prefixURIPairsIdx = getXSLTC().getPrefixURIPairsIdx();
if (prefixURIPairsIdx != null && prefixURIPairsIdx.size() != 0) {
addStaticField(classGen, PREFIX_URIS_IDX_SIG,
STATIC_PREFIX_URIS_IDX_ARRAY_FIELD);
staticConst.markChunkStart();
il.append(new PUSH(cpg, prefixURIPairsIdx.size()));
il.append(new NEWARRAY(BasicType.INT));
int prefixURIPairsIdxArrayRef =
cpg.addFieldref(_className,
STATIC_PREFIX_URIS_IDX_ARRAY_FIELD,
PREFIX_URIS_IDX_SIG);
il.append(new PUTSTATIC(prefixURIPairsIdxArrayRef));