type - the bytecode representation fo the type to
enhance; this can be created from any stream or file

repos - a metadata repository to use for metadata access,
or null to create a new reporitory; the repository
from the given configuration isn't used by default
because the configuration might be an
implementation-specific subclass whose metadata
required more than just base metadata files

PCEnhancer

type - the bytecode representation fo the type to
enhance; this can be created from any stream or file

repos - a metadata repository to use for metadata access,
or null to create a new reporitory; the repository
from the given configuration isn't used by default
because the configuration might be an
implementation-specific subclass whose metadata
required more than just base metadata files

loader - the environment classloader to use for loading
classes and resources.

getPCBytecode

Return the bytecode representation of the persistence-capable class
being manipulated.

getManagedTypeBytecode

public serp.bytecode.BCClass getManagedTypeBytecode()

Return the bytecode representation of the managed class being
manipulated. This is usually the same as getPCBytecode(),
except when running the enhancer to redefine and subclass
existing persistent types.

getMetaData

Return the metadata for the class being manipulated, or null if not
a persistent type.

getAddDefaultConstructor

public boolean getAddDefaultConstructor()

A boolean indicating whether the enhancer should add a no-args
constructor if one is not already present in the class. OpenJPA
requires that a no-arg constructor (whether created by the compiler
or by the user) be present in a PC.

setAddDefaultConstructor

public void setAddDefaultConstructor(boolean addDefaultConstructor)

A boolean indicating whether the enhancer should add a no-args
constructor if one is not already present in the class. OpenJPA
requires that a no-arg constructor (whether created by the compiler
or by the user) be present in a PC.

getRedefine

public boolean getRedefine()

Whether the enhancer should mutate its arguments, or just run validation
and optional subclassing logic on them. Usually used in conjunction with
setCreateSubclass(true).

Since:

1.0.0

setRedefine

public void setRedefine(boolean redefine)

Whether the enhancer should mutate its arguments, or just run validation
and optional subclassing logic on them. Usually used in conjunction with
setCreateSubclass(true).

Since:

1.0.0

isAlreadyRedefined

public boolean isAlreadyRedefined()

Whether the type that this instance is enhancing has already been
redefined.

Since:

1.0.0

isAlreadySubclassed

public boolean isAlreadySubclassed()

Whether the type that this instance is enhancing has already been
subclassed in this instance's environment classloader.

Since:

1.0.0

getCreateSubclass

public boolean getCreateSubclass()

Whether the enhancer should make its arguments persistence-capable,
or generate a persistence-capable subclass.

Since:

1.0.0

setCreateSubclass

public void setCreateSubclass(boolean subclass)

Whether the enhancer should make its arguments persistence-capable,
or generate a persistence-capable subclass.

Since:

1.0.0

getEnforcePropertyRestrictions

public boolean getEnforcePropertyRestrictions()

Whether to fail if the persistent type uses property access and
bytecode analysis shows that it may be violating OpenJPA's property
access restrictions.

setEnforcePropertyRestrictions

public void setEnforcePropertyRestrictions(boolean fail)

Whether to fail if the persistent type uses property access and
bytecode analysis shows that it may be violating OpenJPA's property
access restrictions.

-<property name> <property value>: All bean
properties of the standard OpenJPA OpenJPAConfiguration can be
set by using their names and supplying a value; for example:

-directory/-d <build directory>: The path to the base
directory where enhanced classes are stored. By default, the
enhancer overwrites the original .class file with the enhanced
version. Use this option to store the generated .class file in
another directory. The package structure will be created beneath
the given directory.

Each additional argument can be either the full class name of the
type to enhance, the path to the .java file for the type, 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 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 persistence-capable interface, it will
not be enhanced. Thus, it is safe to invoke the enhancer on classes
that are already enhanced.