Package org.apache.bcel.classfile

Examples of org.apache.bcel.classfile.JavaClass.dump()


                }
            }

            FileOutputStream fout = new FileOutputStream(path);
            DataOutputStream out = new DataOutputStream(fout);
            klass.dump(out);
            fout.close();
        }
        catch (IOException e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here


      // dump the class if we have been configured todo so
      if (CLASS_DUMP_PATH != null) {
         try {
            String filename = CLASS_DUMP_PATH + java.io.File.separator + proxyClassName + ".class";
            log.info("Dumping generated proxy class to " + filename);
            jclass.dump(filename);
         }
         catch (Exception e) {
            log.error("Failed to dump class file", e);
         }
      }
View Full Code Here

                }
            }

            FileOutputStream fout = new FileOutputStream(path);
            DataOutputStream out = new DataOutputStream(fout);
            klass.dump(out);
            fout.close();
        }
        catch (IOException e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

         JavaClass c = clazz.getJavaClass();

         ByteArrayOutputStream baos = new ByteArrayOutputStream(2000);
         BufferedOutputStream bos = new BufferedOutputStream(baos);
         c.dump(bos);
        
         // FIXME: what about ctx cl?
         // FIXME: also I dont know if the parent is right here, have to check later
         ClassLoader ocl = new DispatchClassLoader(resource.getClass().getClassLoader(), className, baos.toByteArray());
View Full Code Here

                }
            }

            FileOutputStream fout = new FileOutputStream(path);
            DataOutputStream out = new DataOutputStream(fout);
            klass.dump(out);
            fout.close();
        }
        catch (IOException e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

  while (classes.hasMoreElements()) {
      final JavaClass clazz = (JavaClass)classes.nextElement();
      final String className = clazz.getClassName().replace('.','/');
      jos.putNextEntry(new JarEntry(className+".class"));
      final ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
      clazz.dump(out); // dump() closes it's output stream
      out.writeTo(jos);
  }
  jos.close();
    }
View Full Code Here

/*     */
/* 197 */     if (CLASS_DUMP_PATH != null) {
/*     */       try {
/* 199 */         String filename = CLASS_DUMP_PATH + File.separator + proxyClassName + ".class";
/* 200 */         log.info("Dumping generated proxy class to " + filename);
/* 201 */         jclass.dump(filename);
/*     */       }
/*     */       catch (Exception e) {
/* 204 */         log.error("Failed to dump class file", e);
/*     */       }
/*     */     }
View Full Code Here

/*     */
/*  84 */       JavaClass c = clazz.getJavaClass();
/*     */
/*  86 */       ByteArrayOutputStream baos = new ByteArrayOutputStream(2000);
/*  87 */       BufferedOutputStream bos = new BufferedOutputStream(baos);
/*  88 */       c.dump(bos);
/*     */
/*  92 */       ClassLoader ocl = new DispatchClassLoader(resource.getClass().getClassLoader(), className, baos.toByteArray());
/*     */
/*  94 */       Class dispatcherClass = ocl.loadClass(className);
/*  95 */       Constructor constr = dispatcherClass.getConstructor(new Class[] { MBeanInfo.class, AttributeOperationResolver.class, Object.class });
View Full Code Here

                }
            }

            FileOutputStream fout = new FileOutputStream(path);
            DataOutputStream out = new DataOutputStream(fout);
            klass.dump(out);
            fout.close();
        }
        catch (IOException e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

            fp.patch(inFile, outFile);
        }
        else if(fp instanceof ClassPatch){
            // YAY! This is special.
            JavaClass c = patchClassName(name, inFile, patches, lastIndex);
            c.dump(outFile);
        }
    }
   
    /**
     * Applies a series of patches to a class.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.