本文整理汇总了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);
}
示例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();
}
}
示例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);
}
}