Package org.aspectj.weaver.bcel
Class BcelWeaver
java.lang.Object
org.aspectj.weaver.bcel.BcelWeaver
- Author:
- PARC, Andy Clement, Alexandre Vasseur
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddClassFile(File classFile, File inPathDir, File outDir)
addClassFile(UnwovenClassFile classFile, boolean fromInpath)
Should be addOrReplaceaddDirectoryContents(File inFile, File outDir)
Add any .class files in the directory to the outdir.addJarFile(File inFile, File outDir, boolean canBeDirectory)
Adds all class files in the jaraddLibraryAspect(String aspectName)
Add the given aspect to the weaver.void
addLibraryJarFile(File inFile)
void
addManifest(Manifest newManifest)
void
addNormalTypeMungers(String typeName)
void
addParentTypeMungers(String typeName)
void
void
deleteClassFile(String typename)
getClassFilesFor(LazyClassGen clazz)
getClassType(String forClass)
helper method - will return NULL if the underlying delegate is an EclipseSourceType and not a BcelObjectTypegetManifest(boolean shouldCreate)
getWorld()
boolean
boolean
void
void
void
processReweavableStateIfPresent(String className, BcelObjectType classType)
void
setCustomMungerFactory(CustomMungerFactory factory)
void
setIsBatchWeave(boolean b)
void
setReweavableMode(boolean xNotReweavable)
void
setShadowMungers(List<ShadowMunger> shadowMungers)
void
tidyUp()
weave(IClassFileProvider input)
void
weaveNormalTypeMungers(ResolvedType onType)
void
weaveParentTypeMungers(ResolvedType onType)
Weaves new parents and annotations onto a type ("declare parents" and "declare @type") Algorithm: 1.weaveWithoutDump(UnwovenClassFile classFile, BcelObjectType classType)
void
-
Field Details
-
CLOSURE_CLASS_PREFIX
- See Also:
- Constant Field Values
-
SYNTHETIC_CLASS_POSTFIX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
BcelWeaver
-
-
Method Details
-
addLibraryAspect
Add the given aspect to the weaver. The type is resolved to support DOT for static inner classes as well as DOLLAR- Parameters:
aspectName
-- Returns:
- aspect
-
addLibraryJarFile
- Parameters:
inFile
- directory containing classes or zip/jar class archive- Throws:
IOException
-
addDirectoryContents
Add any .class files in the directory to the outdir. Anything other than .class files in the directory (or its subdirectories) are considered resources and are also copied.- Throws:
IOException
-
addJarFile
Adds all class files in the jar -
needToReweaveWorld
public boolean needToReweaveWorld() -
addClassFile
Should be addOrReplace -
addClassFile
public UnwovenClassFile addClassFile(File classFile, File inPathDir, File outDir) throws IOException- Throws:
IOException
-
deleteClassFile
-
setIsBatchWeave
public void setIsBatchWeave(boolean b) -
prepareForWeave
public void prepareForWeave() -
setCustomMungerFactory
-
addManifest
-
getManifest
-
weave
- Throws:
IOException
-
weave
- Throws:
IOException
-
allWeavingComplete
public void allWeavingComplete() -
prepareToProcessReweavableState
public void prepareToProcessReweavableState() -
processReweavableStateIfPresent
-
getClassType
helper method - will return NULL if the underlying delegate is an EclipseSourceType and not a BcelObjectType -
addParentTypeMungers
-
addNormalTypeMungers
-
getClassFilesFor
-
weaveParentTypeMungers
Weaves new parents and annotations onto a type ("declare parents" and "declare @type") Algorithm: 1. First pass, do parents then do annotations. During this pass record: - any parent mungers that don't match but have a non-wild annotation type pattern - any annotation mungers that don't match 2. Multiple subsequent passes which go over the munger lists constructed in the first pass, repeatedly applying them until nothing changes. FIXME asc confirm that algorithm is optimal ?? -
weaveNormalTypeMungers
-
weaveWithoutDump
public LazyClassGen weaveWithoutDump(UnwovenClassFile classFile, BcelObjectType classType) throws IOException- Throws:
IOException
-
setReweavableMode
public void setReweavableMode(boolean xNotReweavable) -
isReweavable
public boolean isReweavable() -
getWorld
-
tidyUp
public void tidyUp() -
write
- Throws:
IOException
-
setShadowMungers
-