Mirror
ArrayType
, BooleanType
, ByteType
, CharType
, ClassType
, DoubleType
, FloatType
, IntegerType
, InterfaceType
, LongType
, PrimitiveType
, ReferenceType
, ShortType
, VoidType
public interface Type extends Mirror
A Type may be used to represent a run-time type:
Value
.type()
or a compile-time type:
Field.type()
Method.returnType()
Method.argumentTypes()
LocalVariable.type()
ArrayType.componentType()
The following table illustrates which subinterfaces of Type are used to mirror types in the target VM --
Subinterfaces of PrimitiveType |
||
---|---|---|
Type declared in target as | Is mirrored as an instance of | |
boolean |
BooleanType |
|
byte |
ByteType |
|
char |
CharType |
|
double |
DoubleType |
|
float |
FloatType |
|
int |
IntegerType |
|
long |
LongType |
|
short |
ShortType |
|
void |
VoidType |
|
Subinterfaces of ReferenceType |
||
Type declared in target as | For example | Is mirrored as an instance of |
a class | Date |
ClassType |
an interface | Runnable |
InterfaceType |
an array | ArrayType |
|
an array | int[] |
ArrayType whose
componentType() is
IntegerType |
an array | Date[] |
ArrayType whose
componentType() is
ClassType |
an array | Runnable[] |
ArrayType whose
componentType() is
InterfaceType |
Modifier and Type | Method | Description |
---|---|---|
String |
name() |
|
String |
signature() |
Returns the JNI-style signature for this type.
|
toString, virtualMachine
String signature()
For primitive classes
the returned signature is the signature of the corresponding primitive
type; for example, "I" is returned as the signature of the class
represented by Integer.TYPE
.
String name()
Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1999, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Ubuntu+0-9b151-2