|
|
@@ -34,9 +34,12 @@ import java.util.regex.Pattern; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
import net.bytebuddy.agent.builder.AgentBuilder; |
|
|
|
import net.bytebuddy.description.type.TypeDescription; |
|
|
|
import net.bytebuddy.dynamic.DynamicType; |
|
|
|
import net.bytebuddy.implementation.MethodDelegation; |
|
|
|
import net.bytebuddy.implementation.SuperMethodCall; |
|
|
|
import net.bytebuddy.matcher.ElementMatchers; |
|
|
|
import net.bytebuddy.utility.JavaModule; |
|
|
|
import org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl; |
|
|
|
|
|
|
|
/** |
|
|
@@ -59,11 +62,10 @@ public class OOXMLLiteAgent { |
|
|
|
new AgentBuilder.Default() |
|
|
|
// .with(AgentBuilder.Listener.StreamWriting.toSystemOut()) |
|
|
|
.type(named("org.apache.xmlbeans.impl.schema.XsbReader")) |
|
|
|
.transform((builder, type, cl, m) -> |
|
|
|
builder |
|
|
|
.constructor(ElementMatchers.any()) |
|
|
|
.intercept(MethodDelegation.to(XsbLogger.class).andThen(SuperMethodCall.INSTANCE)) |
|
|
|
) |
|
|
|
.transform(((builder, typeDescription, classLoader, module, protectionDomain) -> |
|
|
|
builder |
|
|
|
.constructor(ElementMatchers.any()) |
|
|
|
.intercept(MethodDelegation.to(XsbLogger.class).andThen(SuperMethodCall.INSTANCE)))) |
|
|
|
.installOn(inst); |
|
|
|
} |
|
|
|
|