Class BytecodeMethod
- java.lang.Object
-
- org.eolang.jeo.representation.bytecode.BytecodeMethod
-
-
Constructor Summary
Constructors Constructor Description BytecodeMethod(BytecodeMethodProperties properties, CustomClassWriter visitor, BytecodeClass clazz, int stack, int locals)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytecodeMethod
annotation(BytecodeAnnotation annotation)
Add annotation.BytecodeMethod
defvalue(BytecodeDefaultValue defvalue)
Add default value.BytecodeMethod
entry(BytecodeEntry entry)
Add some bytecode entry.BytecodeMethod
label(String label)
Add label.BytecodeMethod
label(org.objectweb.asm.Label label)
Add label.BytecodeMethod
opcode(int opcode, Object... args)
Add instruction.String
testCode()
Generate test Java code.BytecodeMethod
trycatch(BytecodeEntry entry)
Add try-catch block.BytecodeClass
up()
Return to the original class.
-
-
-
Constructor Detail
-
BytecodeMethod
public BytecodeMethod(BytecodeMethodProperties properties, CustomClassWriter visitor, BytecodeClass clazz, int stack, int locals)
Constructor.- Parameters:
properties
- Method properties.visitor
- ASM class writer.clazz
- Original class.stack
- Stack size.locals
- Local variables.
-
-
Method Detail
-
up
public BytecodeClass up()
Return to the original class.- Returns:
- Original class.
-
label
public BytecodeMethod label(String label)
Add label.- Parameters:
label
- Label.- Returns:
- This object.
-
label
public BytecodeMethod label(org.objectweb.asm.Label label)
Add label.- Parameters:
label
- Label.- Returns:
- This object.
-
opcode
public BytecodeMethod opcode(int opcode, Object... args)
Add instruction.- Parameters:
opcode
- Opcode.args
- Arguments.- Returns:
- This object.
-
trycatch
public BytecodeMethod trycatch(BytecodeEntry entry)
Add try-catch block.- Parameters:
entry
- Try-catch block.- Returns:
- This object.
-
entry
public BytecodeMethod entry(BytecodeEntry entry)
Add some bytecode entry.- Parameters:
entry
- Entry.- Returns:
- This object.
-
annotation
public BytecodeMethod annotation(BytecodeAnnotation annotation)
Add annotation.- Parameters:
annotation
- Annotation.- Returns:
- This object.
-
defvalue
public BytecodeMethod defvalue(BytecodeDefaultValue defvalue)
Add default value.- Parameters:
defvalue
- Default value.- Returns:
- This object.
-
-