Interface ModuleMainClassAttribute
- All Superinterfaces:
Attribute<ModuleMainClassAttribute>,ClassElement,ClassFileElement
public sealed interface ModuleMainClassAttribute
extends Attribute<ModuleMainClassAttribute>, ClassElement
Models the
ModuleMainClass attribute
(JVMS 4.7.27), which appears on classes that represent module descriptors to indicate the main
class of the module.
This attribute only appears on classes, and does not permit multiple instances in a class. It has a data dependency on the constant pool.
The attribute was introduced in the Java SE Platform version 9, major version 53.
- See Java Virtual Machine Specification:
-
4.7.27 The
ModuleMainClassAttribute - Since:
- 24
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns main class for this module.static ModuleMainClassAttributeof(ClassEntry mainClass) Returns aModuleMainClassattribute.static ModuleMainClassAttributeReturns aModuleMainClassattribute.Methods declared in interface java.lang.classfile.Attribute
attributeMapper, attributeName
-
Method Details
-
mainClass
-
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
-