org.apache.jdo.impl.enhancer
Class ClassFileEnhancerHelper

java.lang.Object
  extended byorg.apache.jdo.impl.enhancer.ClassFileEnhancerHelper

public class ClassFileEnhancerHelper
extends java.lang.Object

This is a helper-class to perform some useful operations outside a byte code enhancer and delegate the real work to the enhancer.


Constructor Summary
ClassFileEnhancerHelper()
           
 
Method Summary
static boolean enhanceClassFile(ClassFileEnhancer enhancer, java.io.InputStream in, java.io.OutputStream out)
          Enhances a classfile.
static boolean enhanceZipFile(ClassFileEnhancer enhancer, java.util.zip.ZipInputStream zip_in, java.util.zip.ZipOutputStream zip_out)
          Enhances a zip file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileEnhancerHelper

public ClassFileEnhancerHelper()
Method Detail

enhanceClassFile

public static boolean enhanceClassFile(ClassFileEnhancer enhancer,
                                       java.io.InputStream in,
                                       java.io.OutputStream out)
                                throws EnhancerUserException,
                                       EnhancerFatalError
Enhances a classfile.

Parameters:
enhancer - The enhancer to delegate the work to.
in - The input stream with the Java class.
out - The output stream to write the enhanced class to.
Returns:
Has the input stream been enhanced?
Throws:
EnhancerUserException - If something went wrong.
EnhancerFatalError - If something went wrong.
See Also:
ClassFileEnhancer.enhanceClassFile(java.io.InputStream, java.io.OutputStream)

enhanceZipFile

public static boolean enhanceZipFile(ClassFileEnhancer enhancer,
                                     java.util.zip.ZipInputStream zip_in,
                                     java.util.zip.ZipOutputStream zip_out)
                              throws EnhancerUserException,
                                     EnhancerFatalError
Enhances a zip file. The zip file is given as a uip input stream. It's entries are read and - if necessary - individually enhanced. The output stream has the same compress?on (if any) as the input stream.

Parameters:
enhancer - The enhancer.
zip_in - The zip input stream.
zip_out - The zip output stream.
Returns:
true if at least one entry of the zip file has been enhanced, false otherwise.
Throws:
EnhancerUserException - If something went wrong.
EnhancerFatalError - If something went wrong.
See Also:
ClassFileEnhancer.enhanceClassFile(java.io.InputStream, java.io.OutputStream)


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.