本文整理汇总了Java中javassist.bytecode.SignatureAttribute.ClassType类的典型用法代码示例。如果您正苦于以下问题:Java ClassType类的具体用法?Java ClassType怎么用?Java ClassType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClassType类属于javassist.bytecode.SignatureAttribute包,在下文中一共展示了ClassType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renameType
import javassist.bytecode.SignatureAttribute.ClassType; //导入依赖的package包/类
private static ClassSignature renameType(ClassSignature type, ReplacerClassMap map) {
TypeParameter[] typeParamTypes = type.getParameters();
if (typeParamTypes != null) {
typeParamTypes = Arrays.copyOf(typeParamTypes, typeParamTypes.length);
for (int i=0; i<typeParamTypes.length; i++) {
TypeParameter newParamType = renameType(typeParamTypes[i], map);
if (newParamType != null) {
typeParamTypes[i] = newParamType;
}
}
}
ClassType superclassType = type.getSuperClass();
if (superclassType != ClassType.OBJECT) {
ClassType newSuperclassType = renameType(superclassType, map);
if (newSuperclassType != null) {
superclassType = newSuperclassType;
}
}
ClassType[] interfaceTypes = type.getInterfaces();
if (interfaceTypes != null) {
interfaceTypes = Arrays.copyOf(interfaceTypes, interfaceTypes.length);
for (int i=0; i<interfaceTypes.length; i++) {
ClassType newInterfaceType = renameType(interfaceTypes[i], map);
if (newInterfaceType != null) {
interfaceTypes[i] = newInterfaceType;
}
}
}
return new ClassSignature(typeParamTypes, superclassType, interfaceTypes);
}
示例2: getClassName
import javassist.bytecode.SignatureAttribute.ClassType; //导入依赖的package包/类
private static String getClassName(ClassType type) {
if (type instanceof NestedClassType) {
NestedClassType nestedType = (NestedClassType)type;
return getClassName(nestedType.getDeclaringClass()) + "$" + Descriptor.toJvmName(type.getName().replace('.', '$'));
} else {
return Descriptor.toJvmName(type.getName());
}
}
示例3: renameType
import javassist.bytecode.SignatureAttribute.ClassType; //导入依赖的package包/类
private static ObjectType renameType(ObjectType type, ReplacerClassMap map)
{
if(type instanceof ArrayType)
return renameType((ArrayType)type, map);
else if(type instanceof ClassType)
return renameType((ClassType)type, map);
else if(type instanceof TypeVariable)
return renameType((TypeVariable)type, map);
else
throw new Error("Don't know how to rename type " + type.getClass());
}
示例4: getClassName
import javassist.bytecode.SignatureAttribute.ClassType; //导入依赖的package包/类
private static String getClassName(ClassType type)
{
if(type instanceof NestedClassType)
{
NestedClassType nestedType = (NestedClassType)type;
return getClassName(nestedType.getDeclaringClass()) + "$"
+ Descriptor.toJvmName(type.getName());
}else
return Descriptor.toJvmName(type.getName());
}