Interface Fld


public interface Fld
Utilities for declaring fields in an ASM ClassVisitor

LATER: We do not yet return a "field handle." Ideally, we would and that would be the required argument for Op.getfield(Emitter, TRef, String, BNonVoid) and related ops.

  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T> void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.SNonVoid type, String name)
    Declare an uninitialized field of any type
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TBool type, String name, boolean init)
    Declare an initialized boolean field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TByte type, String name, byte init)
    Declare an initialized byte field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TDouble type, String name, double init)
    Declare an initialized double field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TFloat type, String name, float init)
    Declare an initialized float field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TInt type, String name, int init)
    Declare an initialized int field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TLong type, String name, long init)
    Declare an initialized long field
    static <T> void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TRef<T> type, String name, T init)
    Declare an initialized reference field
    static void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TShort type, String name, short init)
    Declare an initialized short field
    static <T> void
    decl(org.objectweb.asm.ClassVisitor cv, int flags, org.apache.commons.lang3.reflect.TypeLiteral<T> type, String name)
    Declare an uninitialized field of any type with a type signature
  • Method Details

    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TBool type, String name, boolean init)
      Declare an initialized boolean field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TByte type, String name, byte init)
      Declare an initialized byte field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TShort type, String name, short init)
      Declare an initialized short field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TInt type, String name, int init)
      Declare an initialized int field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TLong type, String name, long init)
      Declare an initialized long field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TFloat type, String name, float init)
      Declare an initialized float field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TDouble type, String name, double init)
      Declare an initialized double field
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static <T> void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.TRef<T> type, String name, T init)
      Declare an initialized reference field

      Note that only certain types of fields can have initial values specified in this manner. A String is one such type. For other types, the initializer must be provided in a generated class initializer (for static fields) or constructor (for instance fields).

      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
      init - the initial value
    • decl

      static <T> void decl(org.objectweb.asm.ClassVisitor cv, int flags, Types.SNonVoid type, String name)
      Declare an uninitialized field of any type
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type
      name - the name
    • decl

      static <T> void decl(org.objectweb.asm.ClassVisitor cv, int flags, org.apache.commons.lang3.reflect.TypeLiteral<T> type, String name)
      Declare an uninitialized field of any type with a type signature
      Parameters:
      cv - the class visitor
      flags - the flags as in ClassVisitor.visitField(int, String, String, String, Object)
      type - the type with signature
      name - the name