public final class ClassDefinition extends Object
Instrumentation.redefineClasses方法。服务绑定,需要重新定义和新的类文件中的字节
类。
Instrumentation.redefineClasses(java.lang.instrument.ClassDefinition...)
| Constructor and Description |
|---|
ClassDefinition(类<?> theClass, byte[] theClassFile)
创建一个新的
ClassDefinition结合使用提供的类和类文件字节。
|
public ClassDefinition(类<?> theClass, byte[] theClassFile)
ClassDefinition结合使用提供的类和类文件字节。不复制提供的缓冲区,只是捕捉到它的参考。
theClass -
类需要重新定义
theClassFile -新的类文件的字节
NullPointerException -如果提供的类或者数组
null。
public 类<?> getDefinitionClass()
类引用的对象的。
public byte[] getDefinitionClassFile()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.