SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.enhance
Class JDOEnhancer

java.lang.Object
  |
  +--com.solarmetric.kodo.enhance.JDOEnhancer

public class JDOEnhancer
extends Object

Bytecode enhancer used to create PersistenceCapable classes from JDO metadata. The bytecode modifications made by this enhancer are consistent with the description of the reference enhancer in the JDO 1.0 Specification.

The enhancer must be invoked on all persistence-capable and persistence aware classes before running any application that uses JDO. Additionally, before the enhancer can be invoked, JDO metadata must be available for all persistence-capable types.

This enhancer differs from the official 1.0 specification in the following ways:


Constructor Summary
JDOEnhancer(serp.bytecode.BCClass type, Configuration conf, ClassResolver resolver)
          Constructor.
 
Method Summary
 boolean enhance()
          Perform bytecode enhancements.
static void enhance(String arg, PrintStream log, Configuration conf, boolean dropCache, ClassResolver resolver, Verifier[] verifiers)
          Deprecated.  
static void enhance(String arg, PrintWriter log, Configuration conf, boolean dropCache, ClassResolver resolver, Verifier[] verifiers)
          Enhance the given class.
static void enhance(String arg, PrintWriter log, Configuration conf, OutputProvider output, boolean dropCache, ClassResolver resolver, Verifier[] verifiers)
          Enhance the given class.
 ClassMetaData getClassMetaData()
          Return the ClassMetaData object for this class, or null if not persistence capable.
 PrintWriter getLog()
          Return the stream being used for logging, or null if none.
 serp.bytecode.BCClass getSourceBytecode()
          Return the bytecode representation of the class being enhanced.
 boolean isPersistenceCapable()
          Return true if the class being enhanced is a PersistenceCapable type.
static void main(String[] args)
          Usage: java com.solarmetric.kodo.enhance.JDOEnhancer [option]* <class name | .class file | .jdo file>+
 void setLog(PrintStream log)
          Deprecated.  
 void setLog(PrintWriter log)
          Set the PrintWrtier to use for status messages.
 void setVerifiers(Verifier[] verifiers)
          Set the verifiers that should be used for this enhancement run.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOEnhancer

public JDOEnhancer(serp.bytecode.BCClass type,
                   Configuration conf,
                   ClassResolver resolver)
Constructor.
Parameters:
type - the bytecode representation fo the type to enhance; this can be created from any stream or file
conf - system configuration
Method Detail

main

public static void main(String[] args)
                 throws Exception

Usage: java com.solarmetric.kodo.enhance.JDOEnhancer [option]* <class name | .class file | .jdo file>+

Where the following options are recognized.

If the license key is not specified otherwise, Kodo will check for default preference files with license keys as outlined in DefaultConfiguration.

Each additional argument can be either the full class name of the type to enhance, the path to the .class file for the type, or the path to a .jdo file listing one or more types to enhance. If the type being enhanced has JDO metadata, it will be enhanced as a persistence capable class. If not, it will be considered a persistence aware class, and all access to fields of persistence capable classes will be replaced by the appropriate get/set method. If the type explicitly declares the PersistenceCapable interface, it will not be enhanced. Thus, it is safe to invoke the enhancer on classes that are already enhanced.


enhance

public static void enhance(String arg,
                           PrintStream log,
                           Configuration conf,
                           boolean dropCache,
                           ClassResolver resolver,
                           Verifier[] verifiers)
                    throws IOException
Deprecated.  

Enhance the given class.
Parameters:
arg - the argument to parse for classes to enhance
log - the stream to log messages to, or null for no log
conf - system configuration
Throws:
IOException - if unable to save enhanced bytecode

enhance

public static void enhance(String arg,
                           PrintWriter log,
                           Configuration conf,
                           boolean dropCache,
                           ClassResolver resolver,
                           Verifier[] verifiers)
                    throws IOException
Enhance the given class.
Parameters:
arg - the argument to parse for classes to enhance
log - the writer to log messages to, or null for no log
conf - system configuration
Throws:
IOException - if unable to save enhanced bytecode

enhance

public static void enhance(String arg,
                           PrintWriter log,
                           Configuration conf,
                           OutputProvider output,
                           boolean dropCache,
                           ClassResolver resolver,
                           Verifier[] verifiers)
                    throws IOException
Enhance the given class.
Parameters:
arg - the argument to parse for classes to enhance
log - the stream to log messages to, or null for no log
conf - system configuration
output - the output provider for a given class
Throws:
IOException - if unable to save enhanced bytecode

setVerifiers

public void setVerifiers(Verifier[] verifiers)
Set the verifiers that should be used for this enhancement run.

getLog

public PrintWriter getLog()
Return the stream being used for logging, or null if none.

setLog

public void setLog(PrintStream log)
Deprecated.  

Set the stream to use for status messages.

setLog

public void setLog(PrintWriter log)
Set the PrintWrtier to use for status messages.

getSourceBytecode

public serp.bytecode.BCClass getSourceBytecode()
Return the bytecode representation of the class being enhanced. The returned bytecode can be written to any file or stream.

isPersistenceCapable

public boolean isPersistenceCapable()
Return true if the class being enhanced is a PersistenceCapable type.

getClassMetaData

public ClassMetaData getClassMetaData()
Return the ClassMetaData object for this class, or null if not persistence capable.

enhance

public boolean enhance()
Perform bytecode enhancements.
Returns:
true if enhancement was performed, false otherwise

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.