org.apache.jdo.impl.enhancer.core
Class EnhancerFilter

java.lang.Object
  extended byorg.apache.jdo.impl.enhancer.util.Assertion
      extended byorg.apache.jdo.impl.enhancer.util.Support
          extended byorg.apache.jdo.impl.enhancer.core.EnhancerFilter
All Implemented Interfaces:
ClassFileEnhancer

public class EnhancerFilter
extends Support
implements ClassFileEnhancer

Provides a JDO byte-code enhancer.


Field Summary
static java.lang.String DO_TIMING_STATISTICS
           
static java.lang.String DUMP_CLASS
           
static java.lang.String NO_ANNOTATE
           
static java.lang.String NO_AUGMENT
           
static java.lang.String VERBOSE_LEVEL
           
static java.lang.String VERBOSE_LEVEL_DEBUG
           
static java.lang.String VERBOSE_LEVEL_QUIET
           
static java.lang.String VERBOSE_LEVEL_VERBOSE
           
static java.lang.String VERBOSE_LEVEL_WARN
           
 
Fields inherited from class org.apache.jdo.impl.enhancer.util.Support
timer
 
Constructor Summary
EnhancerFilter(EnhancerMetaData metaData, java.util.Properties settings, java.io.PrintWriter out, java.io.PrintWriter err)
          Creates an instance of a JDO enhancer.
 
Method Summary
 boolean enhanceClassFile(java.io.InputStream in, java.io.OutputStream out)
          Enhances a given class according to the JDO meta-data.
 boolean enhanceClassFile(java.io.InputStream inClassFile, OutputStreamWrapper outClassFile)
          Enhances a given class according to the JDO meta-data.
protected  void init(EnhancerMetaData metaData, java.util.Properties settings, java.io.PrintWriter out, java.io.PrintWriter err)
          Initializes an instance of a JDO enhancer.
 
Methods inherited from class org.apache.jdo.impl.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
 
Methods inherited from class org.apache.jdo.impl.enhancer.util.Assertion
affirm, affirm, affirm, affirm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_TIMING_STATISTICS

public static final java.lang.String DO_TIMING_STATISTICS
See Also:
Constant Field Values

DUMP_CLASS

public static final java.lang.String DUMP_CLASS
See Also:
Constant Field Values

NO_AUGMENT

public static final java.lang.String NO_AUGMENT
See Also:
Constant Field Values

NO_ANNOTATE

public static final java.lang.String NO_ANNOTATE
See Also:
Constant Field Values

VERBOSE_LEVEL

public static final java.lang.String VERBOSE_LEVEL
See Also:
Constant Field Values

VERBOSE_LEVEL_QUIET

public static final java.lang.String VERBOSE_LEVEL_QUIET
See Also:
Constant Field Values

VERBOSE_LEVEL_WARN

public static final java.lang.String VERBOSE_LEVEL_WARN
See Also:
Constant Field Values

VERBOSE_LEVEL_VERBOSE

public static final java.lang.String VERBOSE_LEVEL_VERBOSE
See Also:
Constant Field Values

VERBOSE_LEVEL_DEBUG

public static final java.lang.String VERBOSE_LEVEL_DEBUG
See Also:
Constant Field Values
Constructor Detail

EnhancerFilter

public EnhancerFilter(EnhancerMetaData metaData,
                      java.util.Properties settings,
                      java.io.PrintWriter out,
                      java.io.PrintWriter err)
               throws EnhancerUserException,
                      EnhancerFatalError
Creates an instance of a JDO enhancer.

Parameters:
metaData - the JDO meta-data object
settings - enhancement properties
out - standard ouput stream for the enhancer
Method Detail

init

protected void init(EnhancerMetaData metaData,
                    java.util.Properties settings,
                    java.io.PrintWriter out,
                    java.io.PrintWriter err)
             throws EnhancerUserException,
                    EnhancerFatalError
Initializes an instance of a JDO enhancer.

Parameters:
metaData - the JDO meta-data object
settings - enhancement properties
out - standard ouput stream for the enhancer
Throws:
EnhancerUserException
EnhancerFatalError

enhanceClassFile

public boolean enhanceClassFile(java.io.InputStream inClassFile,
                                OutputStreamWrapper outClassFile)
                         throws EnhancerUserException,
                                EnhancerFatalError
Enhances a given class according to the JDO meta-data.

Specified by:
enhanceClassFile in interface ClassFileEnhancer
Parameters:
inClassFile - The byte-code of the class to be enhanced.
outClassFile - The byte-code of the enhanced class.
Returns:
true if the class has been enhanced, false otherwise.
Throws:
EnhancerUserException
EnhancerFatalError

enhanceClassFile

public boolean enhanceClassFile(java.io.InputStream in,
                                java.io.OutputStream out)
                         throws EnhancerUserException,
                                EnhancerFatalError
Description copied from interface: ClassFileEnhancer
Enhances a given class according to the JDO meta-data. If the input class has been enhanced or not - the output stream is always written, either with the enhanced class or with the non-enhanced class.

Specified by:
enhanceClassFile in interface ClassFileEnhancer
Parameters:
in - The byte-code of the class to be enhanced.
out - The byte-code of the enhanced class.
Returns:
true if the class has been enhanced, false otherwise.
Throws:
EnhancerUserException
EnhancerFatalError


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