当前位置: 首页>>代码示例>>Java>>正文


Java ClassFile.isInterface方法代码示例

本文整理汇总了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 );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:FieldTransformer.java

示例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;
}
 
开发者ID:anno4j,项目名称:anno4j,代码行数:27,代码来源:CheckForBehaviour.java

示例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);
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:16,代码来源:FieldTransformer.java

示例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;
    }
 
开发者ID:JadiraOrg,项目名称:jadira,代码行数:15,代码来源:JPackage.java

示例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;
    }
 
开发者ID:JadiraOrg,项目名称:jadira,代码行数:12,代码来源:JPackage.java

示例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;
}
 
开发者ID:ljnelson,项目名称:jaxb-tools,代码行数:18,代码来源:ClassFileTrackingAnnotationDB.java

示例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;
}
 
开发者ID:ljnelson,项目名称:jaxb-tools,代码行数:18,代码来源:ClassFileTrackingAnnotationDB.java

示例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;
}
 
开发者ID:ljnelson,项目名称:jaxb-tools,代码行数:18,代码来源:ClassFileTrackingAnnotationDB.java

示例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());
    }
}
 
开发者ID:JadiraOrg,项目名称:jadira,代码行数:7,代码来源:JInterface.java


注:本文中的javassist.bytecode.ClassFile.isInterface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。