/** * Generates code that loads the array that will contain the character * data represented by this Text node, followed by the offset of the * data from the start of the array, and then the length of the data. * * The pre-condition to calling this method is that * canLoadAsArrayOffsetLength() returns true. * @see #canLoadArrayOffsetLength() */ public void loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); // The XSLTC object keeps track of character data // that is to be stored in char arrays. final int offset = xsltc.addCharacterData(_text); final int length = _text.length(); String charDataFieldName = STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1); il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(), charDataFieldName, STATIC_CHAR_DATA_FIELD_SIG))); il.append(new PUSH(cpg, offset)); il.append(new PUSH(cpg, _text.length())); } }
/** * Generates code that loads the array that will contain the character * data represented by this Text node, followed by the offset of the * data from the start of the array, and then the length of the data. * * The pre-condition to calling this method is that * canLoadAsArrayOffsetLength() returns true. * @see #canLoadArrayOffsetLength() */ public void loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); // The XSLTC object keeps track of character data // that is to be stored in char arrays. final int offset = xsltc.addCharacterData(_text); final int length = _text.length(); String charDataFieldName = STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1); il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(), charDataFieldName, STATIC_CHAR_DATA_FIELD_SIG))); il.append(new PUSH(cpg, offset)); il.append(new PUSH(cpg, _text.length())); } }
/** * Generates code that loads the array that will contain the character * data represented by this Text node, followed by the offset of the * data from the start of the array, and then the length of the data. * * The pre-condition to calling this method is that * canLoadAsArrayOffsetLength() returns true. * @see #canLoadArrayOffsetLength() */ public void loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); // The XSLTC object keeps track of character data // that is to be stored in char arrays. final int offset = xsltc.addCharacterData(_text); final int length = _text.length(); String charDataFieldName = STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1); il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(), charDataFieldName, STATIC_CHAR_DATA_FIELD_SIG))); il.append(new PUSH(cpg, offset)); il.append(new PUSH(cpg, _text.length())); } }
/** * Generates code that loads the array that will contain the character * data represented by this Text node, followed by the offset of the * data from the start of the array, and then the length of the data. * * The pre-condition to calling this method is that * canLoadAsArrayOffsetLength() returns true. * @see #canLoadArrayOffsetLength() */ public void loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); // The XSLTC object keeps track of character data // that is to be stored in char arrays. final int offset = xsltc.addCharacterData(_text); final int length = _text.length(); String charDataFieldName = STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1); il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(), charDataFieldName, STATIC_CHAR_DATA_FIELD_SIG))); il.append(new PUSH(cpg, offset)); il.append(new PUSH(cpg, _text.length())); } }