public final class LazyMethodGen extends java.lang.Object implements Traceable
MethodGen
to create and to serialize, but that's it.
At any rate, there are two ways to create LazyMethodGens. One is from a method, which does work through MethodGen to do the correct thing. The other is the creation of a completely empty LazyMethodGen, and it is used when we're constructing code from scratch.
We stay away from targeters for rangey things like Shadows and Exceptions.
Modifier and Type | Field and Description |
---|---|
ResolvedType |
definingType |
Constructor and Description |
---|
LazyMethodGen(org.aspectj.weaver.bcel.BcelMethod m,
LazyClassGen enclosingClass) |
LazyMethodGen(int modifiers,
Type returnType,
java.lang.String name,
Type[] paramTypes,
java.lang.String[] declaredExceptions,
LazyClassGen enclosingClass) |
LazyMethodGen(Method m,
LazyClassGen enclosingClass) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationAJ ax) |
void |
addAttribute(Attribute attribute) |
void |
addExceptionHandler(InstructionHandle start,
InstructionHandle end,
InstructionHandle handlerStart,
ObjectType catchType,
boolean highPriority) |
void |
addParameterAnnotation(int parameterNumber,
AnnotationAJ anno) |
int |
allocateLocal(int slots) |
int |
allocateLocal(Type type) |
void |
assertGoodBody()
A good body is a body with the following properties:
For each branch instruction S in body, target T of S is in body.
|
static void |
assertGoodBody(InstructionList il,
java.lang.String from) |
void |
ensureAllLineNumberSetup()
On entry to this method we have a method whose instruction stream contains a few instructions that have line numbers assigned
to them (LineNumberTags).
|
void |
forcePublic() |
int |
getAccessFlags() |
int |
getAccessFlagsWithoutSynchronized() |
AnnotationAJ[] |
getAnnotations() |
ResolvedType[] |
getAnnotationTypes() |
Type[] |
getArgumentTypes() |
java.util.List<Attribute> |
getAttributes() |
InstructionList |
getBody() |
InstructionList |
getBodyForPrint() |
boolean |
getCanInline() |
java.lang.String |
getClassName() |
ConstantPool |
getConstantPool() |
int |
getDeclarationLineNumber() |
int |
getDeclarationOffset() |
java.lang.String[] |
getDeclaredExceptions() |
AjAttribute.EffectiveSignatureAttribute |
getEffectiveSignature() |
LazyClassGen |
getEnclosingClass() |
java.lang.String |
getGenericReturnTypeSignature() |
int |
getMaxLocals() |
org.aspectj.weaver.bcel.BcelMethod |
getMemberView() |
Method |
getMethod() |
java.lang.String |
getName() |
java.lang.String |
getParameterSignature() |
Type |
getReturnType() |
java.lang.String |
getSignature() |
ISourceLocation |
getSourceLocation() |
boolean |
hasAnnotation(UnresolvedType annotationType) |
boolean |
hasBody() |
boolean |
hasDeclaredLineNumberInfo() |
boolean |
isAbstract() |
boolean |
isBridgeMethod() |
static boolean |
isConstructor(LazyMethodGen aMethod) |
boolean |
isDefault() |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isStatic() |
boolean |
isSynchronized() |
void |
makeSynthetic() |
void |
markAsChanged() |
void |
optimizedPackBody(MethodGen gen) |
MethodGen |
pack() |
void |
packBody(MethodGen gen)
fill the newly created method gen with our body, inspired by InstructionList.copy()
|
void |
print(AjAttribute.WeaverVersionInfo weaverVersion) |
void |
print(java.io.PrintStream out,
AjAttribute.WeaverVersionInfo weaverVersion) |
void |
removeAnnotation(ResolvedType annotationType) |
void |
setAccessFlags(int newFlags) |
void |
setCanInline(boolean canInline) |
void |
setEffectiveSignature(ResolvedMember member,
Shadow.Kind kind,
boolean shouldWeave) |
void |
setMaxLocals(int maxLocals) |
java.lang.String |
toLongString(AjAttribute.WeaverVersionInfo weaverVersion) |
java.lang.String |
toShortString() |
java.lang.String |
toString() |
java.lang.String |
toTraceString() |
public ResolvedType definingType
public LazyMethodGen(int modifiers, Type returnType, java.lang.String name, Type[] paramTypes, java.lang.String[] declaredExceptions, LazyClassGen enclosingClass)
public LazyMethodGen(Method m, LazyClassGen enclosingClass)
public LazyMethodGen(org.aspectj.weaver.bcel.BcelMethod m, LazyClassGen enclosingClass)
public boolean hasDeclaredLineNumberInfo()
public int getDeclarationLineNumber()
public int getDeclarationOffset()
public void addAnnotation(AnnotationAJ ax)
public void removeAnnotation(ResolvedType annotationType)
public void addParameterAnnotation(int parameterNumber, AnnotationAJ anno)
public ResolvedType[] getAnnotationTypes()
public AnnotationAJ[] getAnnotations()
public boolean hasAnnotation(UnresolvedType annotationType)
public void ensureAllLineNumberSetup()
public int allocateLocal(Type type)
public int allocateLocal(int slots)
public Method getMethod()
public void markAsChanged()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public java.lang.String toLongString(AjAttribute.WeaverVersionInfo weaverVersion)
public void print(AjAttribute.WeaverVersionInfo weaverVersion)
public void print(java.io.PrintStream out, AjAttribute.WeaverVersionInfo weaverVersion)
public boolean isStatic()
public boolean isAbstract()
public boolean isBridgeMethod()
public void addExceptionHandler(InstructionHandle start, InstructionHandle end, InstructionHandle handlerStart, ObjectType catchType, boolean highPriority)
public int getAccessFlags()
public int getAccessFlagsWithoutSynchronized()
public boolean isSynchronized()
public void setAccessFlags(int newFlags)
public Type[] getArgumentTypes()
public LazyClassGen getEnclosingClass()
public int getMaxLocals()
public java.lang.String getName()
public java.lang.String getGenericReturnTypeSignature()
public Type getReturnType()
public void setMaxLocals(int maxLocals)
public InstructionList getBody()
public InstructionList getBodyForPrint()
public boolean hasBody()
public java.util.List<Attribute> getAttributes()
public java.lang.String[] getDeclaredExceptions()
public java.lang.String getClassName()
public MethodGen pack()
public void makeSynthetic()
public void packBody(MethodGen gen)
public void optimizedPackBody(MethodGen gen)
public boolean isPrivate()
public boolean isProtected()
public boolean isDefault()
public boolean isPublic()
public void assertGoodBody()
public static void assertGoodBody(InstructionList il, java.lang.String from)
public ISourceLocation getSourceLocation()
public AjAttribute.EffectiveSignatureAttribute getEffectiveSignature()
public void setEffectiveSignature(ResolvedMember member, Shadow.Kind kind, boolean shouldWeave)
public java.lang.String getSignature()
public java.lang.String getParameterSignature()
public org.aspectj.weaver.bcel.BcelMethod getMemberView()
public void forcePublic()
public boolean getCanInline()
public void setCanInline(boolean canInline)
public void addAttribute(Attribute attribute)
public java.lang.String toTraceString()
toTraceString
in interface Traceable
public ConstantPool getConstantPool()
public static boolean isConstructor(LazyMethodGen aMethod)