public interface ClassEnhancer
Modifier and Type | Field and Description |
---|---|
static int |
ASM_API_VERSION
Version of the ASM API to use (introduced in ASM v4 to aid backward compatibility).
|
static String |
OPTION_GENERATE_DEFAULT_CONSTRUCTOR
Option for generating the default constructor.
|
static String |
OPTION_GENERATE_DETACH_LISTENER
Option for use the detach listener.
|
static String |
OPTION_GENERATE_PK
Option for generating the default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
enhance()
Method to enhance the class definition internally.
|
String |
getASMClassName()
Accessor for the ASM class name for the class being enhanced.
|
Class |
getClassBeingEnhanced()
Accessor for the class being enhanced.
|
byte[] |
getClassBytes()
Access the class bytecode.
|
String |
getClassDescriptor()
Accessor for the class descriptor for the class being enhanced
|
ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the ClassLoaderResolver in use.
|
ClassMetaData |
getClassMetaData()
Accessor for the ClassMetaData for the class.
|
String |
getClassName()
Accessor for the name of the class being enhanced.
|
List<ClassField> |
getFieldsList()
Accessor for the fields required.
|
MetaDataManager |
getMetaDataManager()
Accessor for the MetaData manager in use.
|
List<ClassMethod> |
getMethodsList()
Accessor for the methods required.
|
EnhancementNamer |
getNamer() |
byte[] |
getPrimaryKeyClassBytes()
Access the generated primary-key class bytecode.
|
boolean |
hasOption(String name)
Accessor for whether a particular option is enabled.
|
boolean |
isPersistable(String className)
Check if the class is Persistable or is going to be enhanced based on the metadata
|
void |
save(String directoryName)
Method to save the (current) class definition bytecode into a class file.
|
void |
setNamer(EnhancementNamer namer) |
void |
setOptions(Collection<String> options)
Method to set the options controlling the enhancement.
|
boolean |
validate()
Validate whether the class is enhanced.
|
static final int ASM_API_VERSION
static final String OPTION_GENERATE_DEFAULT_CONSTRUCTOR
static final String OPTION_GENERATE_PK
static final String OPTION_GENERATE_DETACH_LISTENER
void setOptions(Collection<String> options)
options
- The optionsboolean hasOption(String name)
name
- Name of the optionboolean validate()
boolean enhance()
void save(String directoryName) throws IOException
directoryName
- Name of a directory (or null to overwrite the class)IOException
- If an I/O error occurs in the write.byte[] getClassBytes()
byte[] getPrimaryKeyClassBytes()
MetaDataManager getMetaDataManager()
ClassLoaderResolver getClassLoaderResolver()
ClassMetaData getClassMetaData()
void setNamer(EnhancementNamer namer)
EnhancementNamer getNamer()
Class getClassBeingEnhanced()
String getClassName()
String getASMClassName()
String getClassDescriptor()
List<ClassMethod> getMethodsList()
List<ClassField> getFieldsList()
boolean isPersistable(String className)
className
- the class nameCopyright © 2019. All rights reserved.