Class XmlMethod
- java.lang.Object
-
- org.eolang.jeo.representation.xmir.XmlMethod
-
public final class XmlMethod extends Object
XML method.- Since:
- 0.1
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaccess()Method access modifiers.List<BytecodeAnnotation>annotations()Method annotations.Optional<XmlDefaultValue>defvalue()Annotation default value.Stringdescriptor()Method descriptor.List<XmlBytecodeEntry>instructions(Predicate<XmlBytecodeEntry>... predicates)All method instructions.booleanisConstructor()Checks if method is a constructor.Optional<XmlMaxs>maxs()Method max stack and locals.Stringname()Method name.List<XmlNode>nodes()All the method instructions.BytecodeMethodPropertiesproperties()Method properties as bytecode.Stringsignature()Method signature.List<XmlTryCatchEntry>trycatchEntries()Method trycatch entries.XmlMethodwithInstructions(XmlNode... entries)Method instructions.XmlMethodwithoutInstructions()Clear instructions.XmlMethodwithoutMaxs()Clear max stack and max locals.
-
-
-
Constructor Detail
-
XmlMethod
public XmlMethod()
Constructor.
-
XmlMethod
public XmlMethod(String name, int access, String descriptor, String... exceptions)
Constructor.- Parameters:
name- Method name.access- Access modifiers.descriptor- Method descriptor.exceptions- Method exceptions.
-
XmlMethod
public XmlMethod(int stack, int locals)Constructor.- Parameters:
stack- Max stack.locals- Max locals.
-
XmlMethod
public XmlMethod(XmlNode xmlnode)
Constructor.- Parameters:
xmlnode- Method node.
-
-
Method Detail
-
name
public String name()
Method name.- Returns:
- Name.
-
access
public int access()
Method access modifiers.- Returns:
- Access modifiers.
-
descriptor
public String descriptor()
Method descriptor.- Returns:
- Descriptor.
-
signature
public String signature()
Method signature.- Returns:
- Signature.
-
trycatchEntries
public List<XmlTryCatchEntry> trycatchEntries()
Method trycatch entries.- Returns:
- Trycatch entries.
-
properties
public BytecodeMethodProperties properties()
Method properties as bytecode.- Returns:
- Properties.
-
isConstructor
public boolean isConstructor()
Checks if method is a constructor.- Returns:
- True if method is a constructor.
-
instructions
@SafeVarargs public final List<XmlBytecodeEntry> instructions(Predicate<XmlBytecodeEntry>... predicates)
All method instructions.- Parameters:
predicates- Predicates to filter instructions.- Returns:
- Instructions.
-
annotations
public List<BytecodeAnnotation> annotations()
Method annotations.- Returns:
- Annotations.
-
withoutMaxs
public XmlMethod withoutMaxs()
Clear max stack and max locals.- Returns:
- Copy of the method without max stack and max locals.
-
withInstructions
public XmlMethod withInstructions(XmlNode... entries)
Method instructions.- Parameters:
entries- Instructions to add.- Returns:
- Copy of the method with added instructions.
-
withoutInstructions
public XmlMethod withoutInstructions()
Clear instructions.- Returns:
- Method without instructions.
-
defvalue
public Optional<XmlDefaultValue> defvalue()
Annotation default value.- Returns:
- Optional XMIR of the default value.
-
-