當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。