public class EnhanceContext extends Object
| Constructor and Description |
|---|
EnhanceContext(ClassBytesReader classBytesReader,
String agentArgs,
Set<String> packages)
Construct a context for enhancement.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassMeta(ClassMeta meta) |
ClassMeta |
createClassMeta()
Create a new meta object for enhancing a class.
|
ClassMeta |
get(String className) |
byte[] |
getClassBytes(String className,
ClassLoader classLoader) |
ClassMeta |
getInterfaceMeta(String interfaceClassName,
ClassLoader classLoader)
Read the class meta data for an interface.
|
int |
getLogLevel()
Return the log level.
|
String |
getProperty(String key)
Return a value from the agent arguments using its key.
|
boolean |
getPropertyBoolean(String key,
boolean dflt) |
ClassMeta |
getSuperMeta(String superClassName,
ClassLoader classLoader)
Read the class meta data for a super class.
|
boolean |
isCheckNullManyFields()
Return true if we should add null checking on *ToMany fields.
|
boolean |
isIgnoreClass(String className)
Return true if this class should be ignored.
|
boolean |
isLog(int level) |
boolean |
isReadOnly()
Return true if this should go through the enhancement process but not
actually save the enhanced classes.
|
boolean |
isTransientInternalFields()
Return true if internal ebean fields in entity classes should be transient.
|
void |
log(int level,
String className,
String msg)
Log some debug output.
|
void |
log(String className,
String msg) |
void |
log(Throwable e)
Log an error.
|
void |
setLogout(MessageOutput logout)
Change the logout to something other than system out.
|
public EnhanceContext(ClassBytesReader classBytesReader, String agentArgs, Set<String> packages)
classBytesReader - used to read class meta data from raw bytesagentArgs - command line arguments for debug level etcpackages - limit enhancement to specified packagespublic byte[] getClassBytes(String className, ClassLoader classLoader)
public String getProperty(String key)
public boolean getPropertyBoolean(String key, boolean dflt)
public boolean isIgnoreClass(String className)
public void setLogout(MessageOutput logout)
public ClassMeta createClassMeta()
public ClassMeta getSuperMeta(String superClassName, ClassLoader classLoader)
Typically used to read meta data for inheritance hierarchy.
public ClassMeta getInterfaceMeta(String interfaceClassName, ClassLoader classLoader)
Typically used to check the interface to see if it is transactional.
public void addClassMeta(ClassMeta meta)
public boolean isLog(int level)
public void log(Throwable e)
public int getLogLevel()
public boolean isReadOnly()
Set this to true to run through the enhancement process without actually doing the enhancement for debugging etc.
public boolean isTransientInternalFields()
public boolean isCheckNullManyFields()
On getting a many that is null Ebean will create an empty List, Set or Map. If it is a ManyToMany it will turn on Modify listening.
Copyright © 2016. All rights reserved.