Files
notes_estom/Java/JavaDemo/codedemo/java/lang/instrument/FirstTransformer.java
2025-09-14 03:49:42 -04:00

27 lines
737 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
*
*/
package cn.aofeng.demo.java.lang.instrument;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;
import cn.aofeng.demo.util.LogUtil;
/**
* 只输出问候语不进行字节码修改的Class转换器。
*
* @author <a href="mailto:aofengblog@163.com">聂勇</a>
*/
public class FirstTransformer implements ClassFileTransformer {
@Override
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
LogUtil.log(">>> %s", className);
return null;
}
}