public boolean isInterface() { return classFile.isInterface(); }
public boolean isInterface() { return clazz.isInterface(); }
public boolean isInterface() { return clazz.isInterface(); }
public boolean isInterface() { return clazz.isInterface(); }
private boolean isSuitableClass(final ClassFile classFile) { String className = classFile.getName(); if (classFile.isInterface()) { log.error(format("Found a type [%s] annotated as a component, but the type is not a concrete class. NOT adding to index file!!", className)); return false; } if (classFile.isAbstract()) { log.error(format("Found a type [%s] annotated as a component, but the type is abstract. NOT adding to index file!!", className)); return false; } // package-info don't count either but its not an error to encounter one return !profileFinder.isPackageClass(classFile); }
private void debugClassFile(final ClassFile classFile) { if (!logger.isDebugEnabled()) { return; } logger.debug(" - class: {}",classFile.getName()); logger.debug(" -- Java version: {}.{}", classFile.getMajorVersion(), classFile.getMinorVersion()); logger.debug(" -- interface: {} abstract: {} final: {}", classFile.isInterface(), classFile.isAbstract(), classFile.isFinal()); logger.debug(" -- extends class: {}",classFile.getSuperclass()); logger.debug(" -- implements interfaces: {}", Arrays.deepToString(classFile.getInterfaces())); }
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; }
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; }
ClassFile classFile = getClassFile(file); if (!classFile.isInterface())
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); } }
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); } }
String proxyName = generateProxyInvocationBytecode(mInfo, methodCount, file.getName(), loader, staticMethod, file.isInterface()); ClassDataStore.instance().registerProxyName(oldClass, proxyName); Transformer.getManipulator().addFakeMethodCallRewrite(file.getName(), mInfo.getName(), mInfo.getDescriptor(), staticMethod ? FakeMethodCallManipulator.Type.STATIC : file.isInterface() ? FakeMethodCallManipulator.Type.INTERFACE : FakeMethodCallManipulator.Type.VIRTUAL, loader, methodCount, proxyName);
modifiedMethods.add(virtMethod); virtMethod.setAccessFlags(AccessFlag.PUBLIC); if (file.isInterface()) { virtMethod.setAccessFlags(AccessFlag.PUBLIC | AccessFlag.ABSTRACT | AccessFlag.SYNTHETIC); } else { if (!file.isInterface()) { try { staticCodeAttribute.computeMaxStack();
modified = true; if (file.isInterface()) { addAbstractMethodForInstrumentation(file); } else {