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


Java TypeDescription.isInterface方法代码示例

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


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

示例1: of

import net.bytebuddy.description.type.TypeDescription; //导入方法依赖的package包/类
/**
 * Wraps the given record in an accessor bridge wrapper if necessary.
 *
 * @param delegate          The delegate for implementing the bridge's target.
 * @param instrumentedType  The instrumented type that defines the bridge methods and the bridge target.
 * @param bridgeTarget      The bridge methods' target methods.
 * @param bridgeTypes       A collection of all tokens representing all bridge methods.
 * @param attributeAppender The attribute appender being applied for the bridge target.
 * @return The given record wrapped by a bridge method wrapper if necessary.
 */
public static Record of(Record delegate,
                        TypeDescription instrumentedType,
                        MethodDescription bridgeTarget,
                        Set<MethodDescription.TypeToken> bridgeTypes,
                        MethodAttributeAppender attributeAppender) {
    Set<MethodDescription.TypeToken> compatibleBridgeTypes = new HashSet<MethodDescription.TypeToken>();
    for (MethodDescription.TypeToken bridgeType : bridgeTypes) {
        if (bridgeTarget.isBridgeCompatible(bridgeType)) {
            compatibleBridgeTypes.add(bridgeType);
        }
    }
    return compatibleBridgeTypes.isEmpty() || (instrumentedType.isInterface() && !delegate.getSort().isImplemented())
            ? delegate
            : new AccessBridgeWrapper(delegate, instrumentedType, bridgeTarget, compatibleBridgeTypes, attributeAppender);
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:26,代码来源:TypeWriter.java

示例2: getCommonSuperClass

import net.bytebuddy.description.type.TypeDescription; //导入方法依赖的package包/类
@Override
protected String getCommonSuperClass(String leftTypeName, String rightTypeName) {
    TypeDescription leftType = typePool.describe(leftTypeName.replace('/', '.')).resolve();
    TypeDescription rightType = typePool.describe(rightTypeName.replace('/', '.')).resolve();
    if (leftType.isAssignableFrom(rightType)) {
        return leftType.getInternalName();
    } else if (leftType.isAssignableTo(rightType)) {
        return rightType.getInternalName();
    } else if (leftType.isInterface() || rightType.isInterface()) {
        return TypeDescription.OBJECT.getInternalName();
    } else {
        do {
            leftType = leftType.getSuperClass().asErasure();
        } while (!leftType.isAssignableFrom(rightType));
        return leftType.getInternalName();
    }
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:18,代码来源:TypeWriter.java

示例3: virtual

import net.bytebuddy.description.type.TypeDescription; //导入方法依赖的package包/类
@Override
public StackManipulation virtual(TypeDescription invocationTarget) {
    if (methodDescription.isPrivate() || methodDescription.isConstructor() || methodDescription.isStatic()) {
        return Illegal.INSTANCE;
    }
    if (invocationTarget.isInterface()) {
        return INTERFACE.new Invocation(methodDescription, invocationTarget);
    } else {
        return VIRTUAL.new Invocation(methodDescription, invocationTarget);
    }
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:12,代码来源:MethodInvocation.java


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