APIdia Launch Partner
Top Description Methods
java.lang.classfile.attribute

public sealed Interface ModuleExportInfo

permits UnboundModuleExportInfo
Known Direct Implementers
jdk.internal.classfile.impl.UnboundAttribute.UnboundModuleExportInfo
Imports
java.lang.classfile.constantpool.ModuleEntry, .PackageEntry, java.lang.constant.ModuleDesc, .PackageDesc, java.lang.module.ModuleDescriptor, java.lang.reflect.AccessFlag, java.util.Collection, .List, .Set, jdk.internal.classfile.impl.TemporaryConstantPool, .UnboundAttribute, .Util

Models a single "exports" declaration in the ModuleAttribute.
Since
24
Java Virtual Machine Specification
4.7.25 The Module Attribute
See Also
ModuleAttribute#exports(), ModuleDescriptor.Exports

Method Summary

Modifier and TypeMethod and Description
public PackageEntry

Returns:

the exported package
exportedPackage
()

Returns the exported package.

public default Set<AccessFlag>

Returns:

the flags associated with this export declaration, as a set of flag enums
exportsFlags
()

Returns the flags associated with this export declaration, as a set of flag enums.

public int

Returns:

the flags associated with this export declaration, as a bit mask
exportsFlagsMask
()

Returns the flags associated with this export declaration, as a bit mask.

public List<ModuleEntry>

Returns:

the list of modules to which this package is exported, or empty if this is an unqualified export
exportsTo
()

Returns the list of modules to which this package is exported, or empty if this is an unqualified export.

public default boolean

Returns:

whether the export declaration has the specified access flag set
has
(AccessFlag
the access flag
flag
)

Returns whether the export declaration has the specified access flag set.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageEntry
the exported package
exports
,
int
the export flags, as a bitmask
exportFlags
,
List<ModuleEntry>
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageEntry
the exported package
exports
,
Collection<AccessFlag>
the export flags
exportFlags
,
List<ModuleEntry>
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageEntry
the exported package
exports
,
int
the export flags, as a bitmask
exportFlags
,
ModuleEntry...
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageEntry
the exported package
exports
,
Collection<AccessFlag>
the export flags
exportFlags
,
ModuleEntry...
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageDesc
the exported package
exports
,
int
the export flags, as a bitmask
exportFlags
,
List<ModuleDesc>
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageDesc
the exported package
exports
,
Collection<AccessFlag>
the export flags
exportFlags
,
List<ModuleDesc>
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageDesc
the exported package
exports
,
int
the export flags, as a bitmask
exportFlags
,
ModuleDesc...
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

public static ModuleExportInfo

Returns:

a module export description
of
(PackageDesc
the exported package
exports
,
Collection<AccessFlag>
the export flags
exportFlags
,
ModuleDesc...
the modules to which this package is exported, or empty if this is an unqualified export
exportsTo
)

Returns a module export description.

Method Detail

exportedPackageback to summary
public PackageEntry exportedPackage()

Returns the exported package.

Returns:PackageEntry

the exported package

See Also
ModuleDescriptor.Exports#source()
exportsFlagsback to summary
public default Set<AccessFlag> exportsFlags()

Returns the flags associated with this export declaration, as a set of flag enums.

Returns:Set<AccessFlag>

the flags associated with this export declaration, as a set of flag enums

Exceptions
IllegalArgumentException:
if the flags mask has any undefined bit set
See Also
ModuleDescriptor.Exports#accessFlags(), AccessFlag.Location#MODULE_EXPORTS
exportsFlagsMaskback to summary
public int exportsFlagsMask()

Returns the flags associated with this export declaration, as a bit mask. It is a u2 value.

Returns:int

the flags associated with this export declaration, as a bit mask

See Also
ModuleDescriptor.Exports#modifiers(), AccessFlag.Location#MODULE_EXPORTS
exportsToback to summary
public List<ModuleEntry> exportsTo()

Returns the list of modules to which this package is exported, or empty if this is an unqualified export.

Returns:List<ModuleEntry>

the list of modules to which this package is exported, or empty if this is an unqualified export

See Also
ModuleDescriptor.Exports#isQualified(), ModuleDescriptor.Exports#targets()
hasback to summary
public default boolean has(AccessFlag flag)

Returns whether the export declaration has the specified access flag set.

Parameters
flag:AccessFlag

the access flag

Returns:boolean

whether the export declaration has the specified access flag set

See Also
AccessFlag.Location#MODULE_EXPORTS
ofback to summary
public static ModuleExportInfo of(PackageEntry exports, int exportFlags, List<ModuleEntry> exportsTo)

Returns a module export description.

Parameters
exports:PackageEntry

the exported package

exportFlags:int

the export flags, as a bitmask

exportsTo:List<ModuleEntry>

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if exportFlags is not u2 or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageEntry exports, Collection<AccessFlag> exportFlags, List<ModuleEntry> exportsTo)

Returns a module export description.

Parameters
exports:PackageEntry

the exported package

exportFlags:Collection<AccessFlag>

the export flags

exportsTo:List<ModuleEntry>

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if any flag cannot be applied to the AccessFlag.Location#MODULE_EXPORTS location, or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageEntry exports, int exportFlags, ModuleEntry... exportsTo)

Returns a module export description.

Parameters
exports:PackageEntry

the exported package

exportFlags:int

the export flags, as a bitmask

exportsTo:ModuleEntry[]

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if exportFlags is not u2 or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageEntry exports, Collection<AccessFlag> exportFlags, ModuleEntry... exportsTo)

Returns a module export description.

Parameters
exports:PackageEntry

the exported package

exportFlags:Collection<AccessFlag>

the export flags

exportsTo:ModuleEntry[]

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if any flag cannot be applied to the AccessFlag.Location#MODULE_EXPORTS location, or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageDesc exports, int exportFlags, List<ModuleDesc> exportsTo)

Returns a module export description.

Parameters
exports:PackageDesc

the exported package

exportFlags:int

the export flags, as a bitmask

exportsTo:List<ModuleDesc>

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if exportFlags is not u2 or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageDesc exports, Collection<AccessFlag> exportFlags, List<ModuleDesc> exportsTo)

Returns a module export description.

Parameters
exports:PackageDesc

the exported package

exportFlags:Collection<AccessFlag>

the export flags

exportsTo:List<ModuleDesc>

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if any flag cannot be applied to the AccessFlag.Location#MODULE_EXPORTS location, or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageDesc exports, int exportFlags, ModuleDesc... exportsTo)

Returns a module export description.

Parameters
exports:PackageDesc

the exported package

exportFlags:int

the export flags, as a bitmask

exportsTo:ModuleDesc[]

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if exportFlags is not u2 or if the number of modules exceeds the limit of u2
ofback to summary
public static ModuleExportInfo of(PackageDesc exports, Collection<AccessFlag> exportFlags, ModuleDesc... exportsTo)

Returns a module export description.

Parameters
exports:PackageDesc

the exported package

exportFlags:Collection<AccessFlag>

the export flags

exportsTo:ModuleDesc[]

the modules to which this package is exported, or empty if this is an unqualified export

Returns:ModuleExportInfo

a module export description

Exceptions
IllegalArgumentException:
if any flag cannot be applied to the AccessFlag.Location#MODULE_EXPORTS location, or if the number of modules exceeds the limit of u2