本文整理汇总了Java中javassist.bytecode.ClassFile.setInterfaces方法的典型用法代码示例。如果您正苦于以下问题:Java ClassFile.setInterfaces方法的具体用法?Java ClassFile.setInterfaces怎么用?Java ClassFile.setInterfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javassist.bytecode.ClassFile
的用法示例。
在下文中一共展示了ClassFile.setInterfaces方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CtNewClass
import javassist.bytecode.ClassFile; //导入方法依赖的package包/类
CtNewClass(String name, ClassPool cp,
boolean isInterface, CtClass superclass) {
super(name, cp);
wasChanged = true;
String superName;
if (isInterface || superclass == null)
superName = null;
else
superName = superclass.getName();
classfile = new ClassFile(isInterface, name, superName);
if (isInterface && superclass != null)
classfile.setInterfaces(new String[] { superclass.getName() });
setModifiers(Modifier.setPublic(getModifiers()));
hasConstructor = isInterface;
}
示例2: addFieldHandledInterface
import javassist.bytecode.ClassFile; //导入方法依赖的package包/类
private void addFieldHandledInterface(ClassFile classfile) {
final String[] interfaceNames = classfile.getInterfaces();
final String[] newInterfaceNames = new String[interfaceNames.length + 1];
System.arraycopy( interfaceNames, 0, newInterfaceNames, 0, interfaceNames.length );
newInterfaceNames[newInterfaceNames.length - 1] = FIELD_HANDLED_TYPE_NAME;
classfile.setInterfaces( newInterfaceNames );
}
示例3: addFieldHandledInterface
import javassist.bytecode.ClassFile; //导入方法依赖的package包/类
private void addFieldHandledInterface(ClassFile classfile) {
String[] interfaceNames = classfile.getInterfaces();
String[] newInterfaceNames = new String[interfaceNames.length + 1];
System.arraycopy(interfaceNames, 0, newInterfaceNames, 0,
interfaceNames.length);
newInterfaceNames[newInterfaceNames.length - 1] = FIELD_HANDLED_TYPE_NAME;
classfile.setInterfaces(newInterfaceNames);
}