public abstract class ClassRef extends java.lang.Object implements FastSerializable
Modifier and Type | Class and Description |
---|---|
static class |
ClassRef.FabricClassRef
ClassRef for classes stored in Fabric.
|
Modifier and Type | Field and Description |
---|---|
static ClassRef |
SURROGATE
ClassRef for fabric.common.Surrogate.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkHash(byte[] hash) |
static ClassRef |
deserialize(byte[] data,
int pos)
Deserializes a ClassRef starting at the given position in the given byte
array.
|
static ClassRef |
deserialize(java.io.DataInput in)
Deserializes a ClassRef from the given DataInput.
|
static java.lang.String |
getClassName(byte[] data,
int pos)
Gets the name of the class represented by the ClassRef starting at the
given position in the given byte array.
|
static ClassRef |
makeRef(java.lang.Class<?> clazz)
Factory method.
|
abstract java.lang.Class<?> |
toClass() |
java.lang.Class<? extends Object._Impl> |
toImplClass() |
java.lang.Class<? extends Object._Proxy> |
toProxyClass() |
void |
write(java.io.DataOutput out)
Serialized format:
byte ClassRefType
byte[] ClassRef-specific data, specified by
writeImpl
|
protected abstract void |
writeImpl(java.io.DataOutput out)
Writes internal representation of this class ref to the given output.
|
public static final ClassRef SURROGATE
public static ClassRef makeRef(java.lang.Class<?> clazz)
clazz
- the class being referenced. If it's a Fabric class, this must be
the interface corresponding to the Fabric type, and not the _Proxy
or _Impl classes.public abstract java.lang.Class<?> toClass()
public java.lang.Class<? extends Object._Impl> toImplClass()
InternalError
- if no _Impl class is found (usually because this is either a Java
class or a Fabric interface)public java.lang.Class<? extends Object._Proxy> toProxyClass()
InternalError
- if no _Proxy class is found (usually because this is not a Fabric
class)protected final void checkHash(byte[] hash)
public final void write(java.io.DataOutput out) throws java.io.IOException
writeImpl
write
in interface FastSerializable
java.io.IOException
protected abstract void writeImpl(java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public static ClassRef deserialize(byte[] data, int pos)
public static ClassRef deserialize(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static java.lang.String getClassName(byte[] data, int pos)