this.defaultFileTransformer = defaultFileTransformer;
this.transformers = transformers;
}
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
ClassFileTransformer transformer = transformers.get(className);
if (transformer != null) {
return transformer.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
}
if (defaultFileTransformer != null && defaultFileTransformer.match(className)) {
return defaultFileTransformer.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
}
return classfileBuffer;