- All Superinterfaces:
AttributedElement,ClassElement,ClassFileElement,CompoundElement<MethodElement>,Iterable<MethodElement>,WritableElement<MethodModel>
- All Known Implementing Classes:
BufferedMethodBuilder.Model,MethodImpl
public sealed interface MethodModel
extends WritableElement<MethodModel>, CompoundElement<MethodElement>, AttributedElement, ClassElement
permits BufferedMethodBuilder.Model, MethodImpl
Models a method. The contents of the method can be traversed via
a streaming view (e.g.,
CompoundElement.elements()), or via random access (e.g.,
flags()), or by freely mixing the two.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the body of this method, if there is one.flags()Returns the access flags.Returns the name of this method.Returns the method descriptor of this method.default MethodTypeDescReturns the method descriptor of this method, as a symbolic descriptor.parent()Returns the class model this method is a member of, if known.Methods inherited from interface org.glavo.classfile.AttributedElement
attributes, findAttribute, findAttributesMethods inherited from interface org.glavo.classfile.CompoundElement
elementList, elements, elementStream, forEachElement, iteratorMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.glavo.classfile.WritableElement
writeTo
-
Method Details
-
flags
AccessFlags flags()Returns the access flags.- Returns:
- the access flags
-
parent
Optional<ClassModel> parent()Returns the class model this method is a member of, if known.- Returns:
- the class model this method is a member of, if known
-
methodName
Utf8Entry methodName()Returns the name of this method.- Returns:
- the name of this method
-
methodType
Utf8Entry methodType()Returns the method descriptor of this method.- Returns:
- the method descriptor of this method
-
methodTypeSymbol
Returns the method descriptor of this method, as a symbolic descriptor.- Returns:
- the method descriptor of this method, as a symbolic descriptor
-
code
Returns the body of this method, if there is one.- Returns:
- the body of this method, if there is one
-