public final class Bridge extends Object
All of these permissions are required to obtain and correctly initialize the instance of Bridge. No security checks are performed on calls made to Bridge instance methods, so access to the Bridge instance must be protected.
This class is a singleton (per ClassLoader of course). Access to the instance is obtained through the Bridge.get() method.
Modifier and Type | Field and Description |
---|---|
static long |
INVALID_FIELD_OFFSET
This constant differs from all results that will ever be returned from
objectFieldOffset(java.lang.reflect.Field) . |
Modifier and Type | Method and Description |
---|---|
static Bridge |
get()
Fetch the Bridge singleton.
|
boolean |
getBoolean(Object o,
long offset) |
byte |
getByte(Object o,
long offset) |
char |
getChar(Object o,
long offset) |
double |
getDouble(Object o,
long offset) |
float |
getFloat(Object o,
long offset) |
int |
getInt(Object o,
long offset)
Fetches a field element within the given
object
o at the given offset. |
ClassLoader |
getLatestUserDefinedLoader()
Obtain the latest user defined ClassLoader from the call stack.
|
long |
getLong(Object o,
long offset) |
Object |
getObject(Object o,
long offset) |
short |
getShort(Object o,
long offset) |
Constructor |
newConstructorForSerialization(Class cl,
Constructor cons)
Obtain a constructor for Class cl using constructor cons which
may be the constructor defined in a superclass of cl.
|
long |
objectFieldOffset(Field f)
Returns the offset of a non-static field.
|
void |
putBoolean(Object o,
long offset,
boolean x) |
void |
putByte(Object o,
long offset,
byte x) |
void |
putChar(Object o,
long offset,
char x) |
void |
putDouble(Object o,
long offset,
double x) |
void |
putFloat(Object o,
long offset,
float x) |
void |
putInt(Object o,
long offset,
int x)
Stores a value into a given Java field.
|
void |
putLong(Object o,
long offset,
long x) |
void |
putObject(Object o,
long offset,
Object x) |
void |
putShort(Object o,
long offset,
short x) |
void |
throwException(Throwable ee)
Throw the exception.
|
public static final long INVALID_FIELD_OFFSET
objectFieldOffset(java.lang.reflect.Field)
.public static final Bridge get()
SecurityException
- if the caller does not have the
required permissions and the caller has a non-null security manager.public final ClassLoader getLatestUserDefinedLoader()
public final int getInt(Object o, long offset)
o
at the given offset.
The result is undefined unless the offset was obtained from
objectFieldOffset(java.lang.reflect.Field)
on the Field
of some Java field and the object referred to by o
is of a class compatible with that field's class.o
- Java heap object in which the field from which the offset
was obtained residesoffset
- indication of where the field resides in a Java heap
objectRuntimeException
- No defined exceptions are thrown, not even
NullPointerException
public final void putInt(Object o, long offset, int x)
The first two parameters are interpreted exactly as with
getInt(Object, long)
to refer to a specific
Java field. The given value is stored into that field.
The field must be of the same type as the method
parameter x
.
o
- Java heap object in which the field resides, if any, else
nulloffset
- indication of where the field resides in a Java heap
object.x
- the value to store into the indicated Java fieldRuntimeException
- No defined exceptions are thrown, not even
NullPointerException
public final Object getObject(Object o, long offset)
getInt(Object, long)
public final void putObject(Object o, long offset, Object x)
putInt(Object, long, int)
public final boolean getBoolean(Object o, long offset)
getInt(Object, long)
public final void putBoolean(Object o, long offset, boolean x)
putInt(Object, long, int)
public final byte getByte(Object o, long offset)
getInt(Object, long)
public final void putByte(Object o, long offset, byte x)
putInt(Object, long, int)
public final short getShort(Object o, long offset)
getInt(Object, long)
public final void putShort(Object o, long offset, short x)
putInt(Object, long, int)
public final char getChar(Object o, long offset)
getInt(Object, long)
public final void putChar(Object o, long offset, char x)
putInt(Object, long, int)
public final long getLong(Object o, long offset)
getInt(Object, long)
public final void putLong(Object o, long offset, long x)
putInt(Object, long, int)
public final float getFloat(Object o, long offset)
getInt(Object, long)
public final void putFloat(Object o, long offset, float x)
putInt(Object, long, int)
public final double getDouble(Object o, long offset)
getInt(Object, long)
public final void putDouble(Object o, long offset, double x)
putInt(Object, long, int)
public final long objectFieldOffset(Field f)
public final void throwException(Throwable ee)
public final Constructor newConstructorForSerialization(Class cl, Constructor cons)
Copyright © 2017 JBoss by Red Hat. All rights reserved.