class file structure that can be viewed as a composition of its
member structures. CompoundElement allows users to traverse these
member elements with forEach(Consumer) or elementStream(),
or buffer the elements obtained from the traversal through iterator() or elementList().
Unless otherwise specified, all member elements of compatible type will be presented during the traversal if they exist in this element. Some member elements specify that they may appear at most once in this element; if such elements are presented multiple times, the latest occurrence is authentic and all previous occurrences should be ignored.
CompoundElements can be constructed by ClassFileBuilders.
ClassFileBuilder#transform(CompoundElement, ClassFileTransform)
provides an easy way to create a new structure by selectively processing
the original member structures and directing the results to the builder.
Membership Elements, ClassFileBuilder
| Modifier and Type | Method and Description |
|---|---|
| public default List | Returns: aList containing all member elements in this compound
elementReturns a |
| public default Stream | Returns: aStream containing all member elements in this compound
elementReturns a |
| public void | forEach(Consumer<? super E>
the handler consumer)Redeclares as abstract: java. Invokes the provided handler with each member element in this compound element. |
| public default Iterator | Returns: anIterator describing all member elements in this
compound elementImplements java. Returns an |
| public default String | Returns: a text representation of the compound element and its contents for debugging purposesReturns a text representation of the compound element and its contents for debugging purposes. |
| elementList | back to summary |
|---|---|
| public default List Returns a | |
| elementStream | back to summary |
|---|---|
| public default Stream Returns a | |
| forEach | back to summary |
|---|---|
| public void forEach(Consumer<? super E> consumer) Redeclares as abstract: java. Invokes the provided handler with each member element in this compound element. | |
| iterator | back to summary |
|---|---|
| public default Iterator Implements java. Returns an | |
| toDebugString | back to summary |
|---|---|
| public default String toDebugString() Returns a text representation of the compound element and its contents for debugging purposes. The format, structure and exact contents of the returned string are not specified and may change at any time in the future.
| |