Class DirectivesMethod
- java.lang.Object
-
- org.eolang.jeo.representation.directives.DirectivesMethod
-
- All Implemented Interfaces:
Iterable<org.xembly.Directive>
public final class DirectivesMethod extends Object implements Iterable<org.xembly.Directive>
Directives Method. All the directives are sorted according to JVM method specification:method_info { u2 access_flags; {@link DirectivesMethodProperties} u2 name_index; {@link DirectivesMethodProperties} u2 descriptor_index; {@link DirectivesMethodProperties} u2 attributes_count; {@link DirectivesMethod} attribute_info attributes[attributes_count]; {@link DirectivesMethod} }Pay attention, that most of the information about methods are stored into attributes: - Body (Code) - Annotations - Try-catch blocks - Default value (for annotation methods) - And other attributes- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description DirectivesMethod(String name)Constructor.DirectivesMethod(String name, DirectivesMethodProperties properties)Constructor.DirectivesMethod(Format format, NumberedName name, DirectivesMethodProperties properties, List<Iterable<org.xembly.Directive>> instructions, List<Iterable<org.xembly.Directive>> tryblocks, DirectivesAnnotations annotations, List<Iterable<org.xembly.Directive>> dvalue, DirectivesAttributes attributes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<org.xembly.Directive>iterator()DirectivesMethodwithAnnotation(DirectivesAnnotation annotation)Add annotation to the directives.DirectivesMethodwithOpcode(int index, int opcode, Object... operands)Add opcode to the directives.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DirectivesMethod
public DirectivesMethod(String name)
Constructor.- Parameters:
name- Method name
-
DirectivesMethod
public DirectivesMethod(String name, DirectivesMethodProperties properties)
Constructor.- Parameters:
name- Method nameproperties- Method properties
-
DirectivesMethod
public DirectivesMethod(Format format, NumberedName name, DirectivesMethodProperties properties, List<Iterable<org.xembly.Directive>> instructions, List<Iterable<org.xembly.Directive>> tryblocks, DirectivesAnnotations annotations, List<Iterable<org.xembly.Directive>> dvalue, DirectivesAttributes attributes)
Constructor.- Parameters:
format- Directives formatname- Method nameproperties- Method propertiesinstructions- Method instructionstryblocks- Method try-catch blocksannotations- Method annotationsdvalue- Annotation default valueattributes- Method attributes- Suppressed Checkstyle violations:
- ParameterNumberCheck (10 lines)
-
-
Method Detail
-
withOpcode
public DirectivesMethod withOpcode(int index, int opcode, Object... operands)
Add opcode to the directives.- Parameters:
index- Instruction indexopcode- Opcodeoperands- Operands- Returns:
- This object
-
withAnnotation
public DirectivesMethod withAnnotation(DirectivesAnnotation annotation)
Add annotation to the directives.- Parameters:
annotation- Annotation directives.- Returns:
- This object.
-
-