com.sun.jdo.api.persistence.enhancer
Class FilterEnhancer

java.lang.Object
  extended by com.sun.jdo.api.persistence.enhancer.util.Assertion
      extended by com.sun.jdo.api.persistence.enhancer.util.Support
          extended by com.sun.jdo.api.persistence.enhancer.FilterEnhancer
All Implemented Interfaces:
ByteCodeEnhancer

public class FilterEnhancer
extends Support
implements ByteCodeEnhancer

Implements a JDO enhancer as a byte-code filtering tool.


Field Summary
static String DO_SIMPLE_TIMING
           
static String VERBOSE_LEVEL
           
static String VERBOSE_LEVEL_DEBUG
           
static String VERBOSE_LEVEL_QUIET
           
static String VERBOSE_LEVEL_VERBOSE
           
static String VERBOSE_LEVEL_WARN
           
 
Fields inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
timer
 
Constructor Summary
FilterEnhancer(JDOMetaData metaData, Properties settings, PrintWriter out, PrintWriter err)
          Creates an instance of a JDO enhancer.
FilterEnhancer(Model metaData, Properties settings, PrintWriter out, PrintWriter err)
          Creates an instance of a JDO enhancer.
FilterEnhancer(Properties metaData, Properties settings, PrintWriter out, PrintWriter err)
          Creates an instance of a JDO enhancer.
 
Method Summary
 boolean enhanceClassFile(InputStream in, OutputStream out)
          Enhances a given class according to the JDO meta-data.
 boolean enhanceClassFile(InputStream inByteCode, OutputStreamWrapper outByteCode)
          Enhances a given class according to the JDO meta-data.
protected  void init(JDOMetaData metaData, Properties settings, PrintWriter out, PrintWriter err)
          Initializes an instance of a JDO enhancer.
 
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
 
Methods inherited from class com.sun.jdo.api.persistence.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_SIMPLE_TIMING

public static final String DO_SIMPLE_TIMING
See Also:
Constant Field Values

VERBOSE_LEVEL

public static final String VERBOSE_LEVEL
See Also:
Constant Field Values

VERBOSE_LEVEL_QUIET

public static final String VERBOSE_LEVEL_QUIET
See Also:
Constant Field Values

VERBOSE_LEVEL_WARN

public static final String VERBOSE_LEVEL_WARN
See Also:
Constant Field Values

VERBOSE_LEVEL_VERBOSE

public static final String VERBOSE_LEVEL_VERBOSE
See Also:
Constant Field Values

VERBOSE_LEVEL_DEBUG

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

FilterEnhancer

public FilterEnhancer(JDOMetaData metaData,
                      Properties settings,
                      PrintWriter out,
                      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
Throws:
EnhancerUserException
EnhancerFatalError

FilterEnhancer

public FilterEnhancer(Properties metaData,
                      Properties settings,
                      PrintWriter out,
                      PrintWriter err)
               throws EnhancerUserException,
                      EnhancerFatalError
Creates an instance of a JDO enhancer.

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

FilterEnhancer

public FilterEnhancer(Model metaData,
                      Properties settings,
                      PrintWriter out,
                      PrintWriter err)
               throws EnhancerUserException,
                      EnhancerFatalError
Creates an instance of a JDO enhancer.

Parameters:
metaData - the JDO model
settings - enhancement properties
out - standard ouput stream for the enhancer
Throws:
EnhancerUserException
EnhancerFatalError
Method Detail

init

protected void init(JDOMetaData metaData,
                    Properties settings,
                    PrintWriter out,
                    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(InputStream inByteCode,
                                OutputStreamWrapper outByteCode)
                         throws EnhancerUserException,
                                EnhancerFatalError
Enhances a given class according to the JDO meta-data.

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

enhanceClassFile

public boolean enhanceClassFile(InputStream in,
                                OutputStream out)
                         throws EnhancerUserException,
                                EnhancerFatalError
Description copied from interface: ByteCodeEnhancer
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 ByteCodeEnhancer
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 © 2012. All Rights Reserved.