Package org.aspectj.weaver.bcel
Class LazyClassGen
java.lang.Object
org.aspectj.weaver.bcel.LazyClassGen
Lazy lazy lazy. We don't unpack the underlying class unless necessary. Things like new methods and annotations accumulate in here
until they must be written out, don't add them to the underlying MethodGen! Things are slightly different if this represents an
Aspect.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ObjectTypestatic ObjectTypestatic ObjectTypestatic ObjectTypestatic ObjectType -
Constructor Summary
ConstructorsConstructorDescriptionLazyClassGen(String class_name, String super_class_name, String file_name, int access_flags, String[] interfaces, World world)LazyClassGen(BcelObjectType myType) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAttribute(Attribute attribute)voidaddAttribute(AjAttribute attribute)voidaddField(FieldGen field, ISourceLocation sourceLocation)voidaddGeneratedInner(LazyClassGen newClass)voidaddInterface(ResolvedType newInterface, ISourceLocation sourceLocation)voidaddMethodGen(LazyMethodGen gen)voidaddMethodGen(LazyMethodGen gen, ISourceLocation sourceLocation)allocateField(String prefix)Return the next available field name with the specified 'prefix', e.g.createExtendedAjcPreClinit(LazyMethodGen previousPreClinit, int i)factory method for building multiple extended clinit methods.static voiddisassemble(String path, String name, PrintStream out)Emit disassembled class and newline to outvoiderrorOnAddedField(FieldGen field, ISourceLocation sourceLocation)booleanfieldExists(String name)voidRetrieve the ajc$preClinit method - this method captures any initialization AspectJ wants to ensure happens in a class.getAnnotationCachingField(BcelShadow shadow, ResolvedType toType, boolean isWithin)Create a field in the type containing the shadow where the annotation retrieved during binding can be stored - for later fast access.getChildClasses(BcelWorld world)getFactoryMethod(Field field, BcelShadow shadow)List<org.aspectj.weaver.bcel.BcelField>String[]getJavaClass(BcelWorld world)byte[]getLazyMethodGen(String name, String signature)getLazyMethodGen(String name, String signature, boolean allowMissing)intgetMajor()intgetMinor()getName()getOrCreateWeaverStateInfo(boolean inReweavableMode)Returns the packagename - if its the default package we return an empty stringgetTjpField(BcelShadow shadow, boolean isEnclosingJp)getType()getWorld()booleanstatic booleanbooleanbooleanbooleanbooleanbooleanisWoven()protected StringmakeLdcClassString(UnresolvedType type)protected StringmakeString(int i)protected StringmakeString(String[] names)protected Stringprotected StringmakeString(UnresolvedType[] types)voidprint()voidprint(PrintStream out)booleanremoveMethodGen(LazyMethodGen gen)voidsetMajorMinor(int major, int minor)voidsetSuperClass(ResolvedType newSuperclass)toString()voidwarnOnAddedInterface(String name, ISourceLocation sourceLocation)voidwarnOnAddedMethod(Method method, ISourceLocation sourceLocation)voidwarnOnAddedStaticInitializer(Shadow shadow, ISourceLocation sourceLocation)voidwarnOnModifiedSerialVersionUID(ISourceLocation sourceLocation, String reason)
-
Field Details
-
proceedingTjpType
-
tjpType
-
staticTjpType
-
typeForAnnotation
-
enclosingStaticTjpType
-
-
Constructor Details
-
LazyClassGen
-
LazyClassGen
-
-
Method Details
-
disassemble
Emit disassembled class and newline to out- Throws:
IOException
-
getNewGeneratedNameTag
-
setMajorMinor
public void setMajorMinor(int major, int minor) -
getMajor
public int getMajor() -
getMinor
public int getMinor() -
hasSerialVersionUIDField
-
getInternalClassName
-
getInternalFileName
-
getPackageName
Returns the packagename - if its the default package we return an empty string -
addMethodGen
-
removeMethodGen
-
addMethodGen
-
errorOnAddedField
-
warnOnAddedInterface
-
warnOnAddedMethod
-
warnOnAddedStaticInitializer
-
warnOnModifiedSerialVersionUID
-
getWorld
-
getMethodGens
-
getFieldGens
-
fieldExists
-
getJavaClass
-
getJavaClassBytesIncludingReweavable
-
addGeneratedInner
-
addInterface
-
setSuperClass
-
getSuperClass
-
getInterfaceNames
-
getChildClasses
-
toString
-
toShortString
-
toLongString
-
print
public void print() -
print
-
getConstantPool
-
getName
-
isWoven
public boolean isWoven() -
isReweavable
public boolean isReweavable() -
getAspectsAffectingType
-
getOrCreateWeaverStateInfo
-
getFactory
-
getStaticInitializer
-
getAjcPreClinit
Retrieve the ajc$preClinit method - this method captures any initialization AspectJ wants to ensure happens in a class. It is called from the static initializer. Maintaining this separation enables overweaving to ignore join points added due to earlier weaves. If the ajc$preClinit method cannot be found, it is created and a call to it is placed in the real static initializer (the call is placed at the start of the static initializer).- Returns:
- the LazyMethodGen representing the ajc$ clinit
-
createExtendedAjcPreClinit
factory method for building multiple extended clinit methods. Constructs a new clinit method that invokes the previous one and then returns it. The index is used as a name suffix.- Parameters:
previousPreClinit-i-
-
getTjpField
-
getAnnotationCachingField
Create a field in the type containing the shadow where the annotation retrieved during binding can be stored - for later fast access.- Parameters:
shadow- the shadow at which the @annotation result is being cached- Returns:
- a field
-
getFactoryMethod
-
makeString
-
makeString
-
makeLdcClassString
-
makeString
-
makeString
-
getType
-
getBcelObjectType
-
getFileName
-
addField
-
getClassName
-
isInterface
public boolean isInterface() -
isAbstract
public boolean isAbstract() -
getLazyMethodGen
-
getLazyMethodGen
-
getLazyMethodGen
-
forcePublic
public void forcePublic() -
hasAnnotation
-
addAnnotation
-
addAttribute
-
addAttribute
-
getAttributes
-
isAtLeastJava5
public boolean isAtLeastJava5() -
allocateField
Return the next available field name with the specified 'prefix', e.g. for prefix 'class$' where class$0, class$1 exist then return class$2
-