Class StringConcatenator


  • public class StringConcatenator
    extends Object
    Bytecode generator for StringBuilder-based concatenation of strings.
    • Constructor Detail

      • StringConcatenator

        public StringConcatenator()
    • Method Detail

      • appendConstant

        public StringConcatenator appendConstant​(String value)
        Registers the given constant string, which will be added on finish().
        Returns:
        this
      • appendVariable

        public StringConcatenator appendVariable​(org.objectweb.asm.tree.InsnList insns,
                                                 org.objectweb.asm.Type type)
        Registers the given code fragment, which will be executed, and the result added on finish().
        Parameters:
        insns - Instructions which must produce exactly one value of type on the operand stack
        Returns:
        this
      • appendVariablePrettily

        public StringConcatenator appendVariablePrettily​(org.objectweb.asm.tree.InsnList code,
                                                         org.objectweb.asm.Type type)
        Registers the given code fragment, which will be executed, and the result added on finish(). If the type is an array, a string, StringBuffer, StringBuilder, CharSequence or a char, then it is 'pretty-printed' i nthe style of a Java constant.
        Parameters:
        code - Instructions which must produce exactly one value of type on the operand stack
        Returns:
        this
      • finish

        public org.objectweb.asm.tree.InsnList finish()
        Returns:
        The InsnList that implements the creation of the string result