public final class Bridge extends BridgeBase
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.
INVALID_FIELD_OFFSET
Modifier and Type | Method and Description |
---|---|
static Bridge |
get()
Fetch the Bridge singleton.
|
ClassLoader |
getLatestUserDefinedLoader()
Obtain the latest user defined ClassLoader from the call stack.
|
boolean |
hasStaticInitializerForSerialization(Class<?> cl)
Returns true if the given class defines a static initializer method,
false otherwise.
|
<T> Constructor<T> |
newConstructorForExternalization(Class<T> cl)
Return a constructor that can be used to create an instance of the class for externalization.
|
<T> Constructor<T> |
newConstructorForSerialization(Class<T> aClass)
Return a no-arg constructor for the specified class, based on the default constructor
for its nearest non-serializable base class.
|
<T> Constructor<T> |
newConstructorForSerialization(Class<T> aClass,
Constructor<?> cons)
Return a no-arg constructor for the specified class which invokes the specified constructor.
|
OptionalDataException |
newOptionalDataExceptionForSerialization(boolean endOfData)
Return a new OptionalDataException instance.
|
MethodHandle |
readObjectForSerialization(Class<?> cl)
Returns a method handle to allow invocation of the specified class's readObject method.
|
MethodHandle |
readResolveForSerialization(Class<?> cl)
Returns a method handle to allow invocation of the specified class's readResolve method.
|
MethodHandle |
writeObjectForSerialization(Class<?> cl)
Returns a method handle to allow invocation of the specified class's writeObject method.
|
MethodHandle |
writeReplaceForSerialization(Class<?> cl)
Returns a method handle to allow invocation of the specified class's writeReplace method.
|
defineClass, ensureClassInitialized, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getObject, getShort, objectFieldOffset, putBoolean, putByte, putChar, putDouble, putFloat, putInt, putLong, putObject, putShort, staticFieldOffset, throwException, toAccessibleField, toAccessibleMethod
public static 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()
BridgeBase
getLatestUserDefinedLoader
in class BridgeBase
public final <T> Constructor<T> newConstructorForExternalization(Class<T> cl)
BridgeBase
newConstructorForExternalization
in class BridgeBase
cl
- the classpublic final <T> Constructor<T> newConstructorForSerialization(Class<T> aClass, Constructor<?> cons)
BridgeBase
newConstructorForSerialization
in class BridgeBase
aClass
- the class for which a constructor should be returned.cons
- the default constructor on which to model the new constructor.public <T> Constructor<T> newConstructorForSerialization(Class<T> aClass)
BridgeBase
newConstructorForSerialization
in class BridgeBase
aClass
- the class for which a constructor should be returned.public boolean hasStaticInitializerForSerialization(Class<?> cl)
BridgeBase
hasStaticInitializerForSerialization
in class BridgeBase
public MethodHandle writeObjectForSerialization(Class<?> cl)
BridgeBase
writeObjectForSerialization
in class BridgeBase
cl
- the class containing the methodpublic MethodHandle readObjectForSerialization(Class<?> cl)
BridgeBase
readObjectForSerialization
in class BridgeBase
cl
- the class containing the methodpublic MethodHandle readResolveForSerialization(Class<?> cl)
BridgeBase
readResolveForSerialization
in class BridgeBase
cl
- the class containing the methodpublic MethodHandle writeReplaceForSerialization(Class<?> cl)
BridgeBase
writeReplaceForSerialization
in class BridgeBase
cl
- the class containing the methodpublic OptionalDataException newOptionalDataExceptionForSerialization(boolean endOfData)
BridgeBase
newOptionalDataExceptionForSerialization
in class BridgeBase
Copyright © 2017 Oracle. All rights reserved.