当前位置: 首页>>代码示例>>Java>>正文


Java Implementation.Target方法代码示例

本文整理汇总了Java中net.bytebuddy.implementation.Implementation.Target方法的典型用法代码示例。如果您正苦于以下问题:Java Implementation.Target方法的具体用法?Java Implementation.Target怎么用?Java Implementation.Target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.bytebuddy.implementation.Implementation的用法示例。


在下文中一共展示了Implementation.Target方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bind

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public MethodBinding bind(Implementation.Target implementationTarget,
                          MethodDescription source,
                          TerminationHandler terminationHandler,
                          MethodInvoker methodInvoker,
                          Assigner assigner) {
    List<MethodBinding> targets = new ArrayList<MethodBinding>();
    for (Record record : records) {
        MethodBinding methodBinding = record.bind(implementationTarget, source, terminationHandler, methodInvoker, assigner);
        if (methodBinding.isValid()) {
            targets.add(methodBinding);
        }
    }
    if (targets.isEmpty()) {
        throw new IllegalArgumentException("None of " + records + " allows for delegation from " + source);
    }
    return bindingResolver.resolve(ambiguityResolver, source, targets);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:19,代码来源:MethodDelegationBinder.java

示例2: bind

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public MethodBinding bind(Implementation.Target implementationTarget,
                          MethodDescription source,
                          MethodDelegationBinder.TerminationHandler terminationHandler,
                          MethodInvoker methodInvoker,
                          Assigner assigner) {
    if (!candidate.isAccessibleTo(implementationTarget.getInstrumentedType())) {
        return MethodBinding.Illegal.INSTANCE;
    }
    StackManipulation methodTermination = terminationHandler.resolve(assigner, typing, source, candidate);
    if (!methodTermination.isValid()) {
        return MethodBinding.Illegal.INSTANCE;
    }
    MethodBinding.Builder methodDelegationBindingBuilder = new MethodBinding.Builder(methodInvoker, candidate);
    for (DelegationProcessor.Handler handler : handlers) {
        ParameterBinding<?> parameterBinding = handler.bind(source, implementationTarget, assigner);
        if (!parameterBinding.isValid() || !methodDelegationBindingBuilder.append(parameterBinding)) {
            return MethodBinding.Illegal.INSTANCE;
        }
    }
    return methodDelegationBindingBuilder.build(methodTermination);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:23,代码来源:TargetMethodAnnotationDrivenBinder.java

示例3: TypeProxy

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
/**
 * Creates a new type proxy.
 *
 * @param proxiedType          The type this proxy should implement which can either be a non-final class or an interface.
 * @param implementationTarget The implementation target this type proxy is created for.
 * @param invocationFactory    The invocation factory for creating special method invocations.
 * @param ignoreFinalizer      {@code true} if any finalizer methods should be ignored for proxying.
 * @param serializableProxy    Determines if the proxy should be serializable.
 */
public TypeProxy(TypeDescription proxiedType,
                 Implementation.Target implementationTarget,
                 InvocationFactory invocationFactory,
                 boolean ignoreFinalizer,
                 boolean serializableProxy) {
    this.proxiedType = proxiedType;
    this.implementationTarget = implementationTarget;
    this.invocationFactory = invocationFactory;
    this.ignoreFinalizer = ignoreFinalizer;
    this.serializableProxy = serializableProxy;
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:21,代码来源:TypeProxy.java

示例4: ForSuperMethodByConstructor

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
/**
 * Creates a new stack operation for creating a type proxy by calling one of its constructors.
 *
 * @param proxiedType           The type for the type proxy to subclass or implement.
 * @param implementationTarget  The implementation target this type proxy is created for.
 * @param constructorParameters The parameter types of the constructor that should be called.
 * @param ignoreFinalizer       {@code true} if any finalizers should be ignored for the delegation.
 * @param serializableProxy     Determines if the proxy should be serializable.
 */
public ForSuperMethodByConstructor(TypeDescription proxiedType,
                                   Implementation.Target implementationTarget,
                                   List<TypeDescription> constructorParameters,
                                   boolean ignoreFinalizer,
                                   boolean serializableProxy) {
    this.proxiedType = proxiedType;
    this.implementationTarget = implementationTarget;
    this.constructorParameters = constructorParameters;
    this.ignoreFinalizer = ignoreFinalizer;
    this.serializableProxy = serializableProxy;
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:21,代码来源:TypeProxy.java

示例5: ForSuperMethodByReflectionFactory

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
/**
 * Creates a new stack operation for reflectively creating a type proxy for the given arguments.
 *
 * @param proxiedType          The type for the type proxy to subclass or implement.
 * @param implementationTarget The implementation target this type proxy is created for.
 * @param ignoreFinalizer      {@code true} if any finalizer methods should be ignored for proxying.
 * @param serializableProxy    Determines if the proxy should be serializable.
 */
public ForSuperMethodByReflectionFactory(TypeDescription proxiedType,
                                         Implementation.Target implementationTarget,
                                         boolean ignoreFinalizer,
                                         boolean serializableProxy) {
    this.proxiedType = proxiedType;
    this.implementationTarget = implementationTarget;
    this.ignoreFinalizer = ignoreFinalizer;
    this.serializableProxy = serializableProxy;
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:18,代码来源:TypeProxy.java

示例6: resolve

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public Implementation.SpecialMethodInvocation resolve(Implementation.Target implementationTarget, MethodDescription source) {
    if (!typeDescription.isInterface()) {
        throw new IllegalStateException(source + " method carries default method call parameter on non-interface type");
    }
    return implementationTarget.invokeDefault(source.asSignatureToken(), typeDescription);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:8,代码来源:DefaultCall.java

示例7: compile

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public MethodRegistry.Compiled compile(Implementation.Target.Factory implementationTargetFactory, ClassFileVersion classFileVersion) {
    Map<Handler, Handler.Compiled> compilationCache = new HashMap<Handler, Handler.Compiled>();
    Map<MethodAttributeAppender.Factory, MethodAttributeAppender> attributeAppenderCache = new HashMap<MethodAttributeAppender.Factory, MethodAttributeAppender>();
    LinkedHashMap<MethodDescription, Compiled.Entry> entries = new LinkedHashMap<MethodDescription, Compiled.Entry>();
    Implementation.Target implementationTarget = implementationTargetFactory.make(instrumentedType, methodGraph, classFileVersion);
    for (Map.Entry<MethodDescription, Entry> entry : implementations.entrySet()) {
        Handler.Compiled cachedHandler = compilationCache.get(entry.getValue().getHandler());
        if (cachedHandler == null) {
            cachedHandler = entry.getValue().getHandler().compile(implementationTarget);
            compilationCache.put(entry.getValue().getHandler(), cachedHandler);
        }
        MethodAttributeAppender cachedAttributeAppender = attributeAppenderCache.get(entry.getValue().getAppenderFactory());
        if (cachedAttributeAppender == null) {
            cachedAttributeAppender = entry.getValue().getAppenderFactory().make(instrumentedType);
            attributeAppenderCache.put(entry.getValue().getAppenderFactory(), cachedAttributeAppender);
        }
        entries.put(entry.getKey(), new Compiled.Entry(cachedHandler,
                cachedAttributeAppender,
                entry.getValue().getMethodDescription(),
                entry.getValue().resolveBridgeTypes(),
                entry.getValue().getVisibility(),
                entry.getValue().isBridgeMethod()));
    }
    return new Compiled(instrumentedType,
            loadedTypeInitializer,
            typeInitializer,
            methods,
            entries,
            classFileVersion.isAtLeast(ClassFileVersion.JAVA_V5));
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:32,代码来源:MethodRegistry.java

示例8: appender

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public ByteCodeAppender appender(Implementation.Target p1) {
	return this;
}
 
开发者ID:Mantaro,项目名称:MantaroRPG,代码行数:5,代码来源:ASMEventHandlerConstructor.java

示例9: appender

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public final ByteCodeAppender appender(Implementation.Target implementationTarget) {
    return new BtGenerateMethodBytecodeAppender(sm);
}
 
开发者ID:project-avral,项目名称:oo-atom,代码行数:5,代码来源:BtGenerateMethod.java

示例10: makeImplementationTarget

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
protected Implementation.Target makeImplementationTarget() {
    return new SubclassImplementationTarget(instrumentedType, methodGraph, defaultMethodInvocation, SubclassImplementationTarget.OriginTypeResolver.SUPER_CLASS);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:SubclassImplementationTargetTest.java

示例11: make

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public Implementation.Target make(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, ClassFileVersion classFileVersion) {
    return new SubclassImplementationTarget(instrumentedType, methodGraph, DefaultMethodInvocation.of(classFileVersion), originTypeResolver);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:SubclassImplementationTarget.java

示例12: makeImplementationTarget

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
protected Implementation.Target makeImplementationTarget() {
    return new RebaseImplementationTarget(instrumentedType, methodGraph, defaultMethodInvocation, Collections.singletonMap(rebasedSignatureToken, resolution));
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:RebaseImplementationTargetTest.java

示例13: make

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
@Override
public Implementation.Target make(TypeDescription instrumentedType, MethodGraph.Linked methodGraph, ClassFileVersion classFileVersion) {
    return RebaseImplementationTarget.of(instrumentedType, methodGraph, classFileVersion, methodRebaseResolver);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:RebaseImplementationTarget.java

示例14: invoke

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
/**
 * Creates a special method invocation to implement for a given method.
 *
 * @param implementationTarget The implementation target the type proxy is created for.
 * @param proxiedType          The type for the type proxy to subclass or implement.
 * @param instrumentedMethod   The instrumented method that is to be invoked.
 * @return A special method invocation of the given method or an illegal invocation if the proxy should
 * throw an {@link java.lang.AbstractMethodError} when the instrumented method is invoked.
 */
Implementation.SpecialMethodInvocation invoke(Implementation.Target implementationTarget,
                                              TypeDescription proxiedType,
                                              MethodDescription instrumentedMethod);
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:13,代码来源:TypeProxy.java

示例15: resolve

import net.bytebuddy.implementation.Implementation; //导入方法依赖的package包/类
/**
 * Resolves the special method invocation to this target.
 *
 * @param implementationTarget The implementation target.
 * @param source               The method being instrumented.
 * @return A special method invocation that represents the super call of this binding.
 */
Implementation.SpecialMethodInvocation resolve(Implementation.Target implementationTarget, MethodDescription source);
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:9,代码来源:DefaultMethod.java


注:本文中的net.bytebuddy.implementation.Implementation.Target方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。