本文整理匯總了Java中javassist.bytecode.ClassFile.isInterface方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassFile.isInterface方法的具體用法?Java ClassFile.isInterface怎麽用?Java ClassFile.isInterface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javassist.bytecode.ClassFile
的用法示例。
在下文中一共展示了ClassFile.isInterface方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: transform
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
/**
* Transform the class defined by the given ClassFile descriptor. The ClassFile descriptor itself is mutated
*
* @param classFile The class file descriptor
*
* @throws Exception Indicates a problem performing the transformation
*/
public void transform(ClassFile classFile) throws Exception {
if ( classFile.isInterface() ) {
return;
}
try {
addFieldHandlerField( classFile );
addGetFieldHandlerMethod( classFile );
addSetFieldHandlerMethod( classFile );
addFieldHandledInterface( classFile );
addReadWriteMethods( classFile );
transformInvokevirtualsIntoPutAndGetfields( classFile );
}
catch (CannotCompileException e) {
throw new RuntimeException( e.getMessage(), e );
}
}
示例2: getClassName
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
public String getClassName(String name, InputStream stream) throws IOException {
// NOTE package-info.class should be excluded
if (!name.endsWith(".class") || name.contains("-"))
return null;
DataInputStream dstream = new DataInputStream(stream);
try {
ClassFile cf = new ClassFile(dstream);
if (!cf.isInterface() && !isAnnotationPresent(cf)) {
// behaviour that implements a concept
for (String fname : cf.getInterfaces()) {
String cn = fname.replace('.', '/') + ".class";
InputStream in = cl.getResource(cn).openStream();
try {
if (super.getClassName(cn, in) != null)
return cf.getName();
} finally {
in.close();
}
}
}
} finally {
dstream.close();
stream.close();
}
return null;
}
示例3: transform
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
public void transform(ClassFile classfile) throws Exception {
if (classfile.isInterface()) {
return;
}
try {
addFieldHandlerField(classfile);
addGetFieldHandlerMethod(classfile);
addSetFieldHandlerMethod(classfile);
addFieldHandledInterface(classfile);
addReadWriteMethods(classfile);
transformInvokevirtualsIntoPutAndGetfields(classfile);
} catch (CannotCompileException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
示例4: getClasses
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
public Set<JClass> getClasses() throws ClasspathAccessException {
Set<JClass> retVal = new HashSet<JClass>();
List<? extends ClassFile> classes = getResolver().getClassFileResolver().resolveAll(null, CLASSPATH_PROJECTOR, new PackageFileFilter(getName(), false), new PackagePrefixFilter(this), new JElementTypeFilter(JClass.class));
for (ClassFile classFile : classes) {
if ((classFile.getSuperclass() != null) &&
(!classFile.isInterface() && (!classFile.getSuperclass().equals("java.lang.Enum"))
&& (classFile.getInnerAccessFlags() == -1))) {
retVal.add(JClass.getJClass(classFile, getResolver()));
}
}
return retVal;
}
示例5: getInterfaces
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
public Set<JInterface> getInterfaces() throws ClasspathAccessException {
Set<JInterface> retVal = new HashSet<JInterface>();
List<? extends ClassFile> classes = getResolver().getClassFileResolver().resolveAll(null, CLASSPATH_PROJECTOR, new PackageFileFilter(getName(), false), new PackageFilter(this), new JElementTypeFilter(JInterface.class));
for (ClassFile classFile : classes) {
if (classFile.isInterface() && (!classFile.getSuperclass().equals("java.lang.annotation.Annotation"))) {
retVal.add(JInterface.getJInterface(classFile, getResolver()));
}
}
return retVal;
}
示例6: scanClass
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
/**
* Overrides the superclass' implementation to track the
* {@link ClassFile} being scanned.
*
* @see #populate(Annotation[], ClassFile)
*/
@Override
protected final void scanClass(final ClassFile cf) {
// Overrides this method to keep track of the ClassFile being scanned.
if (cf == null || !cf.isInterface()) {
this.cf = cf;
} else {
this.cf = null;
}
super.scanClass(cf);
this.cf = null;
}
示例7: scanMethods
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
/**
* Overrides the superclass' implementation to track the
* {@link ClassFile} being scanned.
*
* @see #populate(Annotation[], ClassFile)
*/
@Override
protected final void scanMethods(final ClassFile cf) {
// Overrides this method to keep track of the ClassFile being scanned.
if (cf == null || !cf.isInterface()) {
this.cf = cf;
} else {
this.cf = null;
}
super.scanMethods(cf);
this.cf = null;
}
示例8: scanFields
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
/**
* Overrides the superclass' implementation to track the
* {@link ClassFile} being scanned.
*
* @see #populate(Annotation[], ClassFile)
*/
@Override
protected final void scanFields(final ClassFile cf) {
// Overrides this method to keep track of the ClassFile being scanned.
if (cf == null || !cf.isInterface()) {
this.cf = cf;
} else {
this.cf = null;
}
super.scanFields(cf);
this.cf = null;
}
示例9: JInterface
import javassist.bytecode.ClassFile; //導入方法依賴的package包/類
protected JInterface(ClassFile classFile, ClasspathResolver resolver) {
super(classFile, resolver);
if (!classFile.isInterface() || (classFile.getSuperclass().equals("java.lang.annotation.Annotation"))) {
throw new IllegalArgumentException("Argument was not interface: " + classFile.getName());
}
}