Package de.unkrig.commons.asm
Class StringConcatenator
- java.lang.Object
-
- de.unkrig.commons.asm.StringConcatenator
-
public class StringConcatenator extends Object
Bytecode generator forStringBuilder-based concatenation of strings.
-
-
Constructor Summary
Constructors Constructor Description StringConcatenator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringConcatenatorappendConstant(String value)Registers the given constant string, which will be added onfinish().StringConcatenatorappendVariable(org.objectweb.asm.tree.InsnList insns, org.objectweb.asm.Type type)Registers the given code fragment, which will be executed, and the result added onfinish().StringConcatenatorappendVariablePrettily(org.objectweb.asm.tree.InsnList code, org.objectweb.asm.Type type)Registers the given code fragment, which will be executed, and the result added onfinish().org.objectweb.asm.tree.InsnListfinish()
-
-
-
Method Detail
-
appendConstant
public StringConcatenator appendConstant(String value)
Registers the given constant string, which will be added onfinish().- 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 onfinish().- 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 onfinish(). If the type is an array, a string,StringBuffer,StringBuilder,CharSequenceor achar, 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
InsnListthat implements the creation of the string result
-
-