Package org.aspectj.weaver.bcel
Klasse LazyMethodGen
java.lang.Object
org.aspectj.weaver.bcel.LazyMethodGen
- Alle implementierten Schnittstellen:
Traceable
A LazyMethodGen should be treated as a MethodGen. It's our way of abstracting over the low-level Method objects. It converts
through
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.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorBeschreibungLazyMethodGen
(int modifiers, Type returnType, String name, Type[] paramTypes, String[] declaredExceptions, LazyClassGen enclosingClass) LazyMethodGen
(Method m, LazyClassGen enclosingClass) LazyMethodGen
(org.aspectj.weaver.bcel.BcelMethod m, LazyClassGen enclosingClass) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
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
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, String from) void
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
int
int
Type[]
getBody()
boolean
int
int
String[]
int
org.aspectj.weaver.bcel.BcelMethod
getName()
boolean
hasAnnotation
(UnresolvedType annotationType) boolean
hasBody()
boolean
boolean
boolean
static boolean
isConstructor
(LazyMethodGen aMethod) boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
boolean
void
void
void
pack()
void
fill the newly created method gen with our body, inspired by InstructionList.copy()void
print
(PrintStream out, AjAttribute.WeaverVersionInfo weaverVersion) void
print
(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) toLongString
(AjAttribute.WeaverVersionInfo weaverVersion) toString()
-
Felddetails
-
definingType
-
-
Konstruktordetails
-
LazyMethodGen
public LazyMethodGen(int modifiers, Type returnType, String name, Type[] paramTypes, String[] declaredExceptions, LazyClassGen enclosingClass) -
LazyMethodGen
-
LazyMethodGen
-
-
Methodendetails
-
hasDeclaredLineNumberInfo
public boolean hasDeclaredLineNumberInfo() -
getDeclarationLineNumber
public int getDeclarationLineNumber() -
getDeclarationOffset
public int getDeclarationOffset() -
addAnnotation
-
removeAnnotation
-
addParameterAnnotation
-
getAnnotationTypes
-
getAnnotations
-
hasAnnotation
-
ensureAllLineNumberSetup
public 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). The aim is to ensure every instruction has the right line number. This is necessary because some of them may be extracted out into other methods - and it'd be useful for them to maintain the source line number for debugging. -
allocateLocal
-
allocateLocal
public int allocateLocal(int slots) -
getMethod
-
markAsChanged
public void markAsChanged() -
toString
-
toShortString
-
toLongString
-
print
-
print
-
isStatic
public boolean isStatic() -
isAbstract
public boolean isAbstract() -
isBridgeMethod
public boolean isBridgeMethod() -
addExceptionHandler
public void addExceptionHandler(InstructionHandle start, InstructionHandle end, InstructionHandle handlerStart, ObjectType catchType, boolean highPriority) -
getAccessFlags
public int getAccessFlags() -
getAccessFlagsWithoutSynchronized
public int getAccessFlagsWithoutSynchronized() -
isSynchronized
public boolean isSynchronized() -
setAccessFlags
public void setAccessFlags(int newFlags) -
getArgumentTypes
-
getEnclosingClass
-
getMaxLocals
public int getMaxLocals() -
getName
-
getGenericReturnTypeSignature
-
getReturnType
-
setMaxLocals
public void setMaxLocals(int maxLocals) -
getBody
-
getBodyForPrint
-
hasBody
public boolean hasBody() -
getAttributes
-
getDeclaredExceptions
-
getClassName
-
pack
-
makeSynthetic
public void makeSynthetic() -
packBody
fill the newly created method gen with our body, inspired by InstructionList.copy() -
optimizedPackBody
-
isPrivate
public boolean isPrivate() -
isProtected
public boolean isProtected() -
isDefault
public boolean isDefault() -
isPublic
public boolean isPublic() -
assertGoodBody
public 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.
- For each branch instruction S in body, target T of S has S as a targeter.
- For each instruction T in body, for each branch instruction S that is a targeter of T, S is in body.
- For each non-range-handle instruction T in body, for each instruction S that is a targeter of T, S is either a branch instruction, an exception range or a tag
- For each range-handle instruction T in body, there is exactly one targeter S that is a range.
- For each range-handle instruction T in body, the range R targeting T is in body.
- For each instruction T in body, for each exception range R targeting T, R is in body.
- For each exception range R in body, let T := R.handler. T is in body, and R is one of T's targeters
- All ranges are properly nested: For all ranges Q and R, if Q.start preceeds R.start, then R.end preceeds Q.end.
-
assertGoodBody
-
getSourceLocation
-
getEffectiveSignature
-
setEffectiveSignature
-
getSignature
-
getParameterSignature
-
getMemberView
public org.aspectj.weaver.bcel.BcelMethod getMemberView() -
forcePublic
public void forcePublic() -
getCanInline
public boolean getCanInline() -
setCanInline
public void setCanInline(boolean canInline) -
addAttribute
-
toTraceString
- Angegeben von:
toTraceString
in SchnittstelleTraceable
-
getConstantPool
-
isConstructor
-