/* * Copyright (c) 1998, 2017, 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 tables illustrate 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(any){@link ArrayType}
int[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link IntegerType}
Date[]{@link ArrayType} whose * {@link ArrayType#componentType() componentType()} is * {@link ClassType}
Runnable[]{@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 */ public interface Type extends Mirror { /** * Returns the type signature for this type. The result is of the same * form as the descriptor string returned by {@link Class#descriptorString()}. * The returned string may not be a valid type descriptor. * * @see java.lang.invoke.TypeDescriptor#descriptorString() * @return the type signature */ String signature(); /** * Returns the name of this type. The result is of the same form as * the name returned by {@link Class#getName()}. * The returned name may not be a binary name. * * @see Class#getName() * @return the name of this type */ String name(); }