- 
- All Known Implementing Classes:
- ClassEnhancerImpl
 
 public interface ClassEnhancerInterface representation of an enhancer of a class.
- 
- 
Field SummaryFields Modifier and Type Field Description static intASM_API_VERSIONVersion of the ASM API to use (introduced in ASM v4 to aid backward compatibility).static StringOPTION_GENERATE_DEFAULT_CONSTRUCTOROption for generating the default constructor.static StringOPTION_GENERATE_DETACH_LISTENEROption for use the detach listener.static StringOPTION_GENERATE_PKOption for generating the default constructor.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanenhance()Method to enhance the class definition internally.StringgetASMClassName()Accessor for the ASM class name for the class being enhanced.ClassgetClassBeingEnhanced()Accessor for the class being enhanced.byte[]getClassBytes()Access the class bytecode.StringgetClassDescriptor()Accessor for the class descriptor for the class being enhancedClassLoaderResolvergetClassLoaderResolver()Accessor for the ClassLoaderResolver in use.ClassMetaDatagetClassMetaData()Accessor for the ClassMetaData for the class.StringgetClassName()Accessor for the name of the class being enhanced.List<ClassField>getFieldsList()Accessor for the fields required.MetaDataManagergetMetaDataManager()Accessor for the MetaData manager in use.List<ClassMethod>getMethodsList()Accessor for the methods required.EnhancementNamergetNamer()byte[]getPrimaryKeyClassBytes()Access the generated primary-key class bytecode.booleanhasOption(String name)Accessor for whether a particular option is enabled.booleanisPersistable(String className)Check if the class is Persistable or is going to be enhanced based on the metadatavoidsave(String directoryName)Method to save the (current) class definition bytecode into a class file.voidsetNamer(EnhancementNamer namer)voidsetOptions(Collection<String> options)Method to set the options controlling the enhancement.booleanvalidate()Validate whether the class is enhanced.
 
- 
- 
- 
Field Detail- 
ASM_API_VERSIONstatic final int ASM_API_VERSION Version of the ASM API to use (introduced in ASM v4 to aid backward compatibility).- See Also:
- Constant Field Values
 
 - 
OPTION_GENERATE_DEFAULT_CONSTRUCTORstatic final String OPTION_GENERATE_DEFAULT_CONSTRUCTOR Option for generating the default constructor.- See Also:
- Constant Field Values
 
 - 
OPTION_GENERATE_PKstatic final String OPTION_GENERATE_PK Option for generating the default constructor.- See Also:
- Constant Field Values
 
 - 
OPTION_GENERATE_DETACH_LISTENERstatic final String OPTION_GENERATE_DETACH_LISTENER Option for use the detach listener.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setOptionsvoid setOptions(Collection<String> options) Method to set the options controlling the enhancement.- Parameters:
- options- The options
 
 - 
hasOptionboolean hasOption(String name) Accessor for whether a particular option is enabled.- Parameters:
- name- Name of the option
- Returns:
- Whether it has this option
 
 - 
validateboolean validate() Validate whether the class is enhanced.- Returns:
- Return true if already enhanced class.
 
 - 
enhanceboolean enhance() Method to enhance the class definition internally.- Returns:
- Whether the class was enhanced successfully
 
 - 
savevoid save(String directoryName) throws IOException Method to save the (current) class definition bytecode into a class file. Only has effect if the bytecode has been modified (by enhance()). If directoryName is specified it will be written to $directoryName/className.class else will overwrite the existing class.- Parameters:
- directoryName- Name of a directory (or null to overwrite the class)
- Throws:
- IOException- If an I/O error occurs in the write.
 
 - 
getClassBytesbyte[] getClassBytes() Access the class bytecode.- Returns:
- the class in byte array format
 
 - 
getPrimaryKeyClassBytesbyte[] getPrimaryKeyClassBytes() Access the generated primary-key class bytecode.- Returns:
- the primary-key class in byte array format
 
 - 
getMetaDataManagerMetaDataManager getMetaDataManager() Accessor for the MetaData manager in use.- Returns:
- MetaData manager
 
 - 
getClassLoaderResolverClassLoaderResolver getClassLoaderResolver() Accessor for the ClassLoaderResolver in use.- Returns:
- ClassLoader resolver
 
 - 
getClassMetaDataClassMetaData getClassMetaData() Accessor for the ClassMetaData for the class.- Returns:
- MetaData for the class
 
 - 
setNamervoid setNamer(EnhancementNamer namer) 
 - 
getNamerEnhancementNamer getNamer() 
 - 
getClassBeingEnhancedClass getClassBeingEnhanced() Accessor for the class being enhanced.- Returns:
- Class being enhanced
 
 - 
getClassNameString getClassName() Accessor for the name of the class being enhanced.- Returns:
- Class name
 
 - 
getASMClassNameString getASMClassName() Accessor for the ASM class name for the class being enhanced.- Returns:
- ASM class name
 
 - 
getClassDescriptorString getClassDescriptor() Accessor for the class descriptor for the class being enhanced- Returns:
- class descriptor
 
 - 
getMethodsListList<ClassMethod> getMethodsList() Accessor for the methods required.- Returns:
- List of methods required for enhancement
 
 - 
getFieldsListList<ClassField> getFieldsList() Accessor for the fields required.- Returns:
- List of fields required for enhancement
 
 - 
isPersistableboolean isPersistable(String className) Check if the class is Persistable or is going to be enhanced based on the metadata- Parameters:
- className- the class name
- Returns:
- true if Persistable
 
 
- 
 
-