类 ByteBuddyState
- java.lang.Object
-
- org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState
-
public final class ByteBuddyState extends Object
A utility to hold all ByteBuddy related state, as in the current version of Hibernate the Bytecode Provider state is held in a static field, yet ByteBuddy is able to benefit from some caching and general state reuse.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classByteBuddyState.ProxyDefinitionHelpersShared proxy definition helpers.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ByteBuddyState.ProxyDefinitionHelpersgetProxyDefinitionHelpers()Returns the proxy definition helpers to reuse when defining proxies.Class<?>load(Class<?> referenceClass, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> makeClassFunction)Load a class generated by ByteBuddy.Class<?>loadProxy(Class<?> referenceClass, net.bytebuddy.TypeCache.SimpleKey cacheKey, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> makeProxyFunction)Load a proxy as generated by theProxyFactory.byte[]rewrite(net.bytebuddy.pool.TypePool typePool, String className, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> rewriteClassFunction)Rewrite a class, used by the enhancer.
-
-
-
方法详细资料
-
loadProxy
public Class<?> loadProxy(Class<?> referenceClass, net.bytebuddy.TypeCache.SimpleKey cacheKey, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> makeProxyFunction)
Load a proxy as generated by theProxyFactory.- 参数:
referenceClass- The main class to proxy - might be an interface.cacheKey- The cache key.makeProxyFunction- A function building the proxy.- 返回:
- The loaded proxy class.
-
load
public Class<?> load(Class<?> referenceClass, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> makeClassFunction)
Load a class generated by ByteBuddy.- 参数:
referenceClass- The main class to proxy - might be an interface.makeClassFunction- A function building the class.- 返回:
- The loaded generated class.
-
rewrite
public byte[] rewrite(net.bytebuddy.pool.TypePool typePool, String className, Function<net.bytebuddy.ByteBuddy,net.bytebuddy.dynamic.DynamicType.Builder<?>> rewriteClassFunction)Rewrite a class, used by the enhancer.WARNING: Returns null if rewriteClassFunction returns a null builder. Do not use if you expect the original content.
- 参数:
typePool- the ByteBuddy TypePoolclassName- The original class name.rewriteClassFunction- The function used to rewrite the class.- 返回:
- The rewritten content of the class or null if rewriteClassFunction returns a null builder.
-
getProxyDefinitionHelpers
public ByteBuddyState.ProxyDefinitionHelpers getProxyDefinitionHelpers()
Returns the proxy definition helpers to reuse when defining proxies.These elements are shared as they are immutable.
- 返回:
- The proxy definition helpers.
-
-