Module org.glavo.classfile
Package org.glavo.classfile
Interface CompoundElement<E extends ClassfileElement>
- All Superinterfaces:
ClassfileElement,Iterable<E>
- All Known Subinterfaces:
ClassModel,CodeAttribute,CodeModel,FieldModel,MethodModel
- All Known Implementing Classes:
AbstractUnboundModel,BoundAttribute.BoundCodeAttribute,BufferedCodeBuilder.Model,BufferedFieldBuilder.Model,BufferedMethodBuilder.Model,ClassImpl,CodeImpl,FieldImpl,MethodImpl
public sealed interface CompoundElement<E extends ClassfileElement>
extends ClassfileElement, Iterable<E>
permits ClassModel, CodeModel, FieldModel, MethodModel, AbstractUnboundModel<E>
A
ClassfileElement that has complex structure defined in terms of
other classfile elements, such as a method, field, method body, or entire
class. When encountering a CompoundElement, clients have the
option to treat the element as a single entity (e.g., an entire method)
or to traverse the contents of that element with the methods in this class
(e.g., elements(), forEachElement(Consumer), etc.)-
Method Summary
Modifier and TypeMethodDescriptionReturns anListcontaining all the elements contained in this compound element.elements()Returns anIterabledescribing all the elements contained in this compound element.Returns aStreamcontaining all the elements contained in this compound element.voidforEachElement(Consumer<E> consumer) Invoke the provided handler with each element contained in this compound elementiterator()Returns anIteratordescribing all the elements contained in this compound element.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
forEachElement
Invoke the provided handler with each element contained in this compound element- Parameters:
consumer- the handler
-
elements
Returns anIterabledescribing all the elements contained in this compound element.- Returns:
- an
Iterabledescribing all the elements contained in this compound element
-
iterator
Returns anIteratordescribing all the elements contained in this compound element.- Specified by:
iteratorin interfaceIterable<E extends ClassfileElement>- Returns:
- an
Iteratordescribing all the elements contained in this compound element
-
elementStream
Returns aStreamcontaining all the elements contained in this compound element.- Returns:
- a
Streamcontaining all the elements contained in this compound element
-
elementList
Returns anListcontaining all the elements contained in this compound element.- Returns:
- an
Listcontaining all the elements contained in this compound element
-