- All Superinterfaces:
Attribute<ModuleMainClassAttribute>,ClassElement,ClassFileElement,WritableElement<ModuleMainClassAttribute>
- All Known Implementing Classes:
BoundAttribute.BoundModuleMainClassAttribute,UnboundAttribute.UnboundModuleMainClassAttribute
public sealed interface ModuleMainClassAttribute
extends Attribute<ModuleMainClassAttribute>, ClassElement
permits BoundAttribute.BoundModuleMainClassAttribute, UnboundAttribute.UnboundModuleMainClassAttribute
Models the
ModuleMainClass attribute , which can
appear on classes that represent module descriptors.
Delivered as a ClassElement when
traversing the elements of a ClassModel.
The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.
The attribute was introduced in the Java SE Platform version 9.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionReturns main class for this module.static ModuleMainClassAttributeReturns aModuleMainClassattribute.static ModuleMainClassAttributeof(ClassEntry mainClass) Returns aModuleMainClassattribute.Methods inherited from interface org.glavo.classfile.Attribute
attributeMapper, attributeNameMethods inherited from interface org.glavo.classfile.WritableElement
writeTo
-
Method Details
-
mainClass
ClassEntry mainClass()Returns main class for this module.- Returns:
- main class for this module
-
of
Returns aModuleMainClassattribute.- Parameters:
mainClass- the main class- Returns:
- a
ModuleMainClassattribute
-
of
Returns aModuleMainClassattribute.- Parameters:
mainClass- the main class- Returns:
- a
ModuleMainClassattribute - Throws:
IllegalArgumentException- ifmainClassrepresents a primitive type
-