类 SignatureWriter

java.lang.Object
cn.taketoday.bytecode.signature.SignatureVisitor
cn.taketoday.bytecode.signature.SignatureWriter

public class SignatureWriter extends SignatureVisitor
A SignatureVisitor that generates signature literals, as defined in the Java Virtual Machine Specification (JVMS).
作者:
Thomas Hallgren, Eric Bruneton
另请参阅:
  • 字段详细资料

    • stringBuilder

      private final StringBuilder stringBuilder
      The builder used to construct the visited signature.
    • hasFormals

      private boolean hasFormals
      Whether the visited signature contains formal type parameters.
    • hasParameters

      private boolean hasParameters
      Whether the visited signature contains method parameter types.
    • argumentStack

      private int argumentStack
      The stack used to keep track of class types that have arguments. Each element of this stack is a boolean encoded in one bit. The top of the stack is the least significant bit. Pushing false = *2, pushing true = *2+1, popping = /2.

      Class type arguments must be surrounded with '<' and '>' and, because

      1. class types can be nested (because type arguments can themselves be class types),
      2. SignatureWriter always returns 'this' in each visit* method (to avoid allocating new SignatureWriter instances),

      we need a stack to properly balance these 'parentheses'. A new element is pushed on this stack for each new visited type, and popped when the visit of this type ends (either is visitEnd, or because visitInnerClassType is called).

  • 构造器详细资料

    • SignatureWriter

      public SignatureWriter()
      Constructs a new SignatureWriter.
  • 方法详细资料