/* * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.jdi; /** * The mirror for a type in the target VM. * This interface is the root of a type hierarchy encompassing primitive * types and reference types. *

* A Type may be used to represent a run-time type: *

* {@link Value}.type() *
* or a compile-time type: *
* {@link Field#type()}
* {@link Method#returnType()}
* {@link Method#argumentTypes()}
* {@link LocalVariable#type()}
* {@link ArrayType#componentType()} *
*

* The following table illustrates which subinterfaces of Type * are used to mirror types in the target VM -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Subinterfaces of {@link PrimitiveType}
Type declared in target asIs mirrored as an instance of
boolean {@link BooleanType}
byte{@link ByteType}
char{@link CharType}
double{@link DoubleType}
float{@link FloatType}
int{@link IntegerType}
long{@link LongType}
short{@link ShortType}
void{@link VoidType}
Subinterfaces of {@link ReferenceType}
Type declared in target asFor exampleIs mirrored as an instance of
a classDate{@link ClassType}
an interfaceRunnable{@link InterfaceType}
an array {@link ArrayType}
an arrayint[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link IntegerType}
an arrayDate[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link ClassType}
an arrayRunnable[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link InterfaceType}
* * @see PrimitiveType Subinterface PrimitiveType * @see ReferenceType Subinterface ReferenceType * @see Value Value - for relationship between Type and Value * @see Field#type() Field.type() - for usage examples * * @author Robert Field * @author Gordon Hirsch * @author James McIlree * @since 1.3 */ @jdk.Supported public interface Type extends Mirror { /** * Returns the JNI-style signature for this type. *

* 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 {@link java.lang.Integer#TYPE}. * * @see Type Signatures * @return the string containing the type signature. */ String signature(); /** * @return a text representation of this type. */ String name(); }