- All Superinterfaces:
ClassFileElement
- All Known Subinterfaces:
ClassModel,CodeAttribute,CodeModel,FieldModel,MethodModel,RecordComponentInfo
- All Known Implementing Classes:
AbstractUnboundModel,BoundAttribute.BoundCodeAttribute,BoundRecordComponentInfo,BufferedCodeBuilder.Model,BufferedFieldBuilder.Model,BufferedMethodBuilder.Model,ClassImpl,CodeImpl,FieldImpl,MethodImpl,UnboundAttribute.UnboundRecordComponentInfo
public sealed interface AttributedElement
extends ClassFileElement
permits ClassModel, CodeModel, FieldModel, MethodModel, RecordComponentInfo, AbstractUnboundModel<E>
A
ClassFileElement describing an entity that has attributes, such
as a class, field, method, code attribute, or record component.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of this element.findAttribute(AttributeMapper<T> attr) Finds an attribute by name.findAttributes(AttributeMapper<T> attr) Finds one or more attributes by name.
-
Method Details
-
attributes
Returns the attributes of this element.- Returns:
- the attributes of this element
-
findAttribute
Finds an attribute by name.- Type Parameters:
T- the type of the attribute- Parameters:
attr- the attribute mapper- Returns:
- the attribute, or an empty Optional if the attribute is not present
-
findAttributes
Finds one or more attributes by name.- Type Parameters:
T- the type of the attribute- Parameters:
attr- the attribute mapper- Returns:
- the attributes, or an empty List if the attribute is not present
-