public abstract class FieldRef extends Object
| Modifier and Type | Field and Description |
|---|---|
static FieldRef |
BOOLEAN_DATA_FALSE |
static FieldRef |
BOOLEAN_DATA_TRUE |
static FieldRef |
EMPTY_DICT |
static FieldRef |
EMPTY_MAP |
static FieldRef |
NULL_PROVIDER |
| Constructor and Description |
|---|
FieldRef() |
| Modifier and Type | Method and Description |
|---|---|
Expression |
accessor()
Returns an expression that accesses this static field.
|
Expression |
accessor(Expression owner)
Returns an accessor that accesses this field on the given owner.
|
FieldRef |
asNonNull() |
static FieldRef |
create(TypeInfo owner,
String name,
org.objectweb.asm.Type type,
int accessFlags,
boolean isNullable) |
static FieldRef |
createField(TypeInfo owner,
String name,
Class<?> type) |
static FieldRef |
createField(TypeInfo owner,
String name,
org.objectweb.asm.Type type) |
static FieldRef |
createFinalField(TypeInfo owner,
String name,
Class<?> type) |
static FieldRef |
createFinalField(TypeInfo owner,
String name,
org.objectweb.asm.Type type) |
static FieldRef |
createPublicStaticField(TypeInfo owner,
String name,
org.objectweb.asm.Type type) |
void |
defineField(org.objectweb.asm.ClassVisitor cv)
Defines the given field as member of the class.
|
static <T extends Enum<T>> |
enumReference(T enumInstance) |
static FieldRef |
instanceFieldReference(Class<?> owner,
String name) |
boolean |
isStatic() |
abstract String |
name() |
abstract TypeInfo |
owner()
The type that owns this field.
|
Statement |
putInstanceField(Expression instance,
Expression value)
|
Statement |
putStaticField(Expression value)
|
void |
putUnchecked(CodeBuilder adapter)
Adds code to place the top item of the stack into this field.
|
static FieldRef |
staticFieldReference(Class<?> owner,
String name) |
static FieldRef |
staticFieldReference(Field field) |
abstract org.objectweb.asm.Type |
type() |
public static final FieldRef BOOLEAN_DATA_FALSE
public static final FieldRef BOOLEAN_DATA_TRUE
public static final FieldRef NULL_PROVIDER
public static final FieldRef EMPTY_DICT
public static final FieldRef EMPTY_MAP
public static FieldRef createFinalField(TypeInfo owner, String name, Class<?> type)
public static FieldRef createFinalField(TypeInfo owner, String name, org.objectweb.asm.Type type)
public static FieldRef createPublicStaticField(TypeInfo owner, String name, org.objectweb.asm.Type type)
public static FieldRef createField(TypeInfo owner, String name, org.objectweb.asm.Type type)
public abstract TypeInfo owner()
public abstract String name()
public abstract org.objectweb.asm.Type type()
public final boolean isStatic()
public void defineField(org.objectweb.asm.ClassVisitor cv)
public FieldRef asNonNull()
public Expression accessor(Expression owner)
public Expression accessor()
public Statement putInstanceField(Expression instance, Expression value)
IllegalStateException - if this is a static fieldpublic Statement putStaticField(Expression value)
IllegalStateException - if this is a static fieldpublic void putUnchecked(CodeBuilder adapter)
IllegalStateException - if this is a static field