本文整理匯總了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);
}