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 java.lang.String DO_SIMPLE_TIMING
           
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 com.sun.jdo.api.persistence.enhancer.util.Support
timer
 
Constructor Summary
FilterEnhancer(JDOMetaData metaData, java.util.Properties settings, java.io.PrintWriter out, java.io.PrintWriter err)
          Creates an instance of a JDO enhancer.
FilterEnhancer(Model metaData, java.util.Properties settings, java.io.PrintWriter out, java.io.PrintWriter err)
          Creates an instance of a JDO enhancer.
FilterEnhancer(java.util.Properties 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 inByteCode, OutputStreamWrapper outByteCode)
          Enhances a given class according to the JDO meta-data.
protected  void init(JDOMetaData metaData, java.util.Properties settings, java.io.PrintWriter out, java.io.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 java.lang.String DO_SIMPLE_TIMING
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

FilterEnhancer

public FilterEnhancer(JDOMetaData 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
Throws:
EnhancerUserException
EnhancerFatalError

FilterEnhancer

public FilterEnhancer(java.util.Properties 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 properties
settings - enhancement properties
out - standard ouput stream for the enhancer
Throws:
EnhancerUserException
EnhancerFatalError

FilterEnhancer

public FilterEnhancer(Model 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 model
settings - enhancement properties
out - standard ouput stream for the enhancer
Throws:
EnhancerUserException
EnhancerFatalError
Method Detail

init

protected void init(JDOMetaData 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 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(java.io.InputStream in,
                                java.io.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 GlassFish Community. All Rights Reserved.