Class BytecodeTryCatchBlock
- java.lang.Object
-
- org.eolang.jeo.representation.bytecode.BytecodeTryCatchBlock
-
- All Implemented Interfaces:
BytecodeEntry
public final class BytecodeTryCatchBlock extends Object implements BytecodeEntry
Bytecode try-catch block.- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description BytecodeTryCatchBlock(String start, String end, String handler, String type)
Constructor.BytecodeTryCatchBlock(BytecodeLabel startlabel, BytecodeLabel endlabel, BytecodeLabel handlerlabel, String exception)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<org.xembly.Directive>
directives(boolean counting)
Convert entry to directives.int
impact()
Impact of the instruction on the stack.boolean
isIf()
Is this instruction a conditional branch?boolean
isJump()
Is this instruction a goto? Is it a goto or jsr?boolean
isLabel()
Is this instruction a label?boolean
isOpcode()
Is this instruction a regular opcode?boolean
isReturn()
Is this instruction a return statement?boolean
isSwitch()
Is this instruction a switch?boolean
isThrow()
Is this instruction a throw statement?List<BytecodeLabel>
jumps()
Jump to a label.String
view()
Human-readable representation.void
writeTo(org.objectweb.asm.MethodVisitor visitor, AsmLabels labels)
Write instruction to the method visitor.
-
-
-
Constructor Detail
-
BytecodeTryCatchBlock
public BytecodeTryCatchBlock(String start, String end, String handler, String type)
Constructor.- Parameters:
start
- Start label.end
- End label.handler
- Handler label.type
- Exception type.- Suppressed Checkstyle violations:
- ParameterNumberCheck (5 lines)
-
BytecodeTryCatchBlock
public BytecodeTryCatchBlock(BytecodeLabel startlabel, BytecodeLabel endlabel, BytecodeLabel handlerlabel, String exception)
Constructor.- Parameters:
startlabel
- Start label.endlabel
- End label.handlerlabel
- Handler label.exception
- Exception type.- Suppressed Checkstyle violations:
- ParameterNumberCheck (5 lines)
-
-
Method Detail
-
writeTo
public void writeTo(org.objectweb.asm.MethodVisitor visitor, AsmLabels labels)
Description copied from interface:BytecodeEntry
Write instruction to the method visitor.- Specified by:
writeTo
in interfaceBytecodeEntry
- Parameters:
visitor
- Method visitor.labels
- Method labels.
-
directives
public Iterable<org.xembly.Directive> directives(boolean counting)
Description copied from interface:BytecodeEntry
Convert entry to directives.- Specified by:
directives
in interfaceBytecodeEntry
- Parameters:
counting
- Do we need to add numbers to entry names?- Returns:
- Directives.
-
isLabel
public boolean isLabel()
Description copied from interface:BytecodeEntry
Is this instruction a label?- Specified by:
isLabel
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isSwitch
public boolean isSwitch()
Description copied from interface:BytecodeEntry
Is this instruction a switch?- Specified by:
isSwitch
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isJump
public boolean isJump()
Description copied from interface:BytecodeEntry
Is this instruction a goto? Is it a goto or jsr?- Specified by:
isJump
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isIf
public boolean isIf()
Description copied from interface:BytecodeEntry
Is this instruction a conditional branch?- Specified by:
isIf
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isReturn
public boolean isReturn()
Description copied from interface:BytecodeEntry
Is this instruction a return statement?- Specified by:
isReturn
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isThrow
public boolean isThrow()
Description copied from interface:BytecodeEntry
Is this instruction a throw statement?- Specified by:
isThrow
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
isOpcode
public boolean isOpcode()
Description copied from interface:BytecodeEntry
Is this instruction a regular opcode?- Specified by:
isOpcode
in interfaceBytecodeEntry
- Returns:
- True if it is.
-
impact
public int impact()
Description copied from interface:BytecodeEntry
Impact of the instruction on the stack.- Specified by:
impact
in interfaceBytecodeEntry
- Returns:
- Stack impact.
-
jumps
public List<BytecodeLabel> jumps()
Description copied from interface:BytecodeEntry
Jump to a label. Where to jump.- Specified by:
jumps
in interfaceBytecodeEntry
- Returns:
- Jumps.
-
view
public String view()
Description copied from interface:BytecodeEntry
Human-readable representation.- Specified by:
view
in interfaceBytecodeEntry
- Returns:
- Text.
-
-