本文整理匯總了Java中javassist.bytecode.SignatureAttribute.TypeParameter類的典型用法代碼示例。如果您正苦於以下問題:Java TypeParameter類的具體用法?Java TypeParameter怎麽用?Java TypeParameter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TypeParameter類屬於javassist.bytecode.SignatureAttribute包,在下文中一共展示了TypeParameter類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renameType
import javassist.bytecode.SignatureAttribute.TypeParameter; //導入依賴的package包/類
private static TypeParameter renameType(TypeParameter type, ReplacerClassMap map) {
ObjectType superclassType = type.getClassBound();
if (superclassType != null) {
ObjectType newSuperclassType = renameType(superclassType, map);
if (newSuperclassType != null) {
superclassType = newSuperclassType;
}
}
ObjectType[] interfaceTypes = type.getInterfaceBound();
if (interfaceTypes != null) {
interfaceTypes = Arrays.copyOf(interfaceTypes, interfaceTypes.length);
for (int i=0; i<interfaceTypes.length; i++) {
ObjectType newInterfaceType = renameType(interfaceTypes[i], map);
if (newInterfaceType != null) {
interfaceTypes[i] = newInterfaceType;
}
}
}
return new TypeParameter(type.getName(), superclassType, interfaceTypes);
}
示例2: renameType
import javassist.bytecode.SignatureAttribute.TypeParameter; //導入依賴的package包/類
private static TypeParameter renameType(TypeParameter type,
ReplacerClassMap map)
{
ObjectType superclassType = type.getClassBound();
if(superclassType != null)
{
ObjectType newSuperclassType = renameType(superclassType, map);
if(newSuperclassType != null)
superclassType = newSuperclassType;
}
ObjectType[] interfaceTypes = type.getInterfaceBound();
if(interfaceTypes != null)
{
interfaceTypes =
Arrays.copyOf(interfaceTypes, interfaceTypes.length);
for(int i = 0; i < interfaceTypes.length; i++)
{
ObjectType newInterfaceType =
renameType(interfaceTypes[i], map);
if(newInterfaceType != null)
interfaceTypes[i] = newInterfaceType;
}
}
return new TypeParameter(type.getName(), superclassType, interfaceTypes);
}