模块 jdk.jdi

接口 Value

所有父级接口:
Mirror
所有已知的子接口:
ArrayReference , BooleanValue , ByteValue , CharValue , ClassLoaderReference , ClassObjectReference , DoubleValue , FloatValue , IntegerValue , LongValue , ModuleReference , ObjectReference , PrimitiveValue , ShortValue , StringReference , ThreadGroupReference , ThreadReference , VoidValue

public interface Value extends Mirror
目标 VM 中某个值的镜像。该接口是包含原始值和对象值的值层次结构的根。

可以访问值的一些示例:

ObjectReference.getValue(Field) - 一个字段的值
StackFrame.getValue(LocalVariable) - 变量的值
VirtualMachine.mirrorOf(double) - 由 JDI 客户端在目标 VM 中创建
ModificationWatchpointEvent.valueToBe() - 返回一个事件

下表说明了 Value 的哪些子接口用于镜像目标 VM 中的值——

PrimitiveValue 的子接口
一种值 例如 -
目标表达
被镜像为
实例
Type 的值
Value.type()
一个boolean true BooleanValue BooleanType
一个字节 (byte)4 ByteValue ByteType
一个字符 'a' CharValue CharType
一个双 3.1415926 DoubleValue DoubleType
一个浮动 2.5f FloatValue FloatType
一个整数 22 IntegerValue IntegerType
沿着 1024L LongValue LongType
一个短 (short)12 ShortValue ShortType
避免 VoidValue VoidType
ObjectReference 的子接口
一种值 例如 -
目标表达
被镜像为
实例
Type 的值
Value.type()
类实例 this ObjectReference ClassType
数组 new int[5] ArrayReference ArrayType
一个字符串 "hello" StringReference ClassType
一个线程 Thread.currentThread() ThreadReference ClassType
一个线程组 Thread.currentThread()
  .getThreadGroup()
ThreadGroupReference ClassType
java.lang.Class
实例
this.getClass() ClassObjectReference ClassType
类加载器 this.getClass()
  .getClassLoader()
ClassLoaderReference ClassType
其他值
一种值 例如 -
目标表达
镜像为 Type 的值
无效的 null null n/a
自从:
1.3
  • 方法总结

    修饰符和类型
    方法
    描述
    type()
    返回此值的运行时类型。

    在接口 com.sun.jdi.Mirror 中声明的方法

    toString, virtualMachine
  • 方法详情

    • type

      Type  type()
      返回此值的运行时类型。
      返回:
      Type 反映了目标 VM 中值的类型。
      参见: