Package io.ebean.enhance.common
Class EnhanceContext
java.lang.Object
io.ebean.enhance.common.EnhanceContext
Used to hold meta data, arguments and log levels for the enhancement.
-
Constructor Summary
ConstructorsConstructorDescriptionEnhanceContext(ClassBytesReader classBytesReader, String agentArgs, AgentManifest manifest) EnhanceContext(ClassBytesReader classBytesReader, String agentArgs, AgentManifest manifest, ClassMetaCache metaCache) Construct a context for enhancement. -
Method Summary
Modifier and TypeMethodDescriptionintintintvoidaddClassMeta(ClassMeta meta) voidTurn on the summary collection of the enhancement.Create a new meta object for enhancing a class.booleandetectEntityTransactionalEnhancement(String className) Return true if this class should be scanned for transactional enhancement.booleandetectQueryBeanEnhancement(String className) Return true if this class should be scanned for query bean enhancement.byte[]getClassBytes(String className, ClassLoader classLoader) getInterfaceMeta(String interfaceClassName, ClassLoader classLoader) Read the class meta data for an interface.intReturn the log level.Return the summary of the packages controlling enhancement.Return the summary of the enhancement.getSuperMeta(String superClassName, ClassLoader classLoader) Read the class meta data for a super class.booleanbooleanReturn true if we should add null checking on *ToMany fields.booleanReturn true if profile location enhancement is on.booleanisIgnoreClass(String className) Return true if this class should be ignored.booleanisLog(int level) booleanisQueryBean(String owner, ClassLoader classLoader) Return true if the owner class is a type query bean.booleanReturn true if transform should throw exception rather than log and return null.booleanbooleanReturn true if internal ebean fields in entity classes should be transient.voidLog some debug output.voidvoidLog an error.voidsetLogLevel(int logLevel) voidsetLogout(MessageOutput logout) Change the logout to something other than system out.voidsetThrowOnError(boolean throwOnError) Set to true if you want transform to throw exceptions rather than return null.voidsummaryEntity(String className) Add the entity enhanced class to summary information.voidsummaryQueryBean(String className) Add the query bean enhanced class to summary information.voidsummaryQueryBeanCaller(String className) Add the query bean caller enhanced class to summary information.voidsummaryTransactional(String className) Add the transactional enhanced class to summary information.voidvisitMethodInsnIntercept(MethodVisitor mv, String name, String desc) voidwithClassLoader(ClassLoader loader)
-
Constructor Details
-
EnhanceContext
-
EnhanceContext
public EnhanceContext(ClassBytesReader classBytesReader, String agentArgs, AgentManifest manifest, ClassMetaCache metaCache) Construct a context for enhancement.
-
-
Method Details
-
withClassLoader
-
setLogLevel
-
getPackagesSummary
Return the summary of the packages controlling enhancement. -
getEntityPackages
-
getTransactionalPackages
-
getQuerybeanPackages
-
getClassBytes
-
isQueryBean
Return true if the owner class is a type query bean.If true typically means the caller needs to change GETFIELD calls to instead invoke the generated 'property access' methods.
-
isEnableProfileLocation
Return true if profile location enhancement is on. -
detectEntityTransactionalEnhancement
Return true if this class should be scanned for transactional enhancement. -
detectQueryBeanEnhancement
Return true if this class should be scanned for query bean enhancement. -
isIgnoreClass
Return true if this class should be ignored. That is JDK classes and known libraries JDBC drivers etc can be skipped. -
setLogout
Change the logout to something other than system out. -
createClassMeta
Create a new meta object for enhancing a class. -
getSuperMeta
Read the class meta data for a super class.Typically used to read meta data for inheritance hierarchy.
-
getInterfaceMeta
Read the class meta data for an interface.Typically used to check the interface to see if it is transactional.
-
addClassMeta
-
get
-
log
Log some debug output. -
log
-
isLog
-
log
Log an error. -
getLogLevel
Return the log level. -
isTransientInternalFields
Return true if internal ebean fields in entity classes should be transient. -
isCheckNullManyFields
Return true if we should add null checking on *ToMany fields.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.
-
isThrowOnError
Return true if transform should throw exception rather than log and return null. -
setThrowOnError
Set to true if you want transform to throw exceptions rather than return null. -
collectSummary
Turn on the summary collection of the enhancement. -
summaryTransactional
Add the transactional enhanced class to summary information. -
summaryEntity
Add the entity enhanced class to summary information. -
summaryQueryBean
Add the query bean enhanced class to summary information. -
summaryQueryBeanCaller
Add the query bean caller enhanced class to summary information. -
getSummaryInfo
Return the summary of the enhancement.Note that
collectSummary()must be called in order for summary information to be collected and returned here. -
accPublic
-
accProtected
-
accPrivate
-
isToManyGetField
-
interceptNew
-
visitMethodInsnIntercept
-
interceptAddReadOnly
-