Record Class Export
java.lang.Object
java.lang.Record
com.google.javascript.jscomp.modules.Export
- Record Components:
exportName
- Returns the name of this export or null if this is anexport * from
.moduleRequest
- Returns the module identifier of an export from or null if this is not anexport {} from
orexport * from
.importName
- Returns the name imported from another module. * if import all or null if not anexport {} from
.localName
- Returns the local name of this export or null if none. *default* if default.modulePath
- Returns the path of the containing moduleexportNode
- Node that this export originates from. Used for its source location.Null only if from non-ES module or from a missing ES module.
nameNode
- Node that this export originates from. Used for its source location.Null only if from non-ES6 module or an export syntax that has no associated name, e.g.
export * from
.moduleMetadata
- The module that contains this export.mutated
- Whether or not this export is potentially mutated after module execution (i.e. in a function scope).
public record Export(@Nullable String exportName, @Nullable String moduleRequest, @Nullable String importName, @Nullable String localName, @Nullable ModuleLoader.ModulePath modulePath, @Nullable Node exportNode, @Nullable Node nameNode, ModuleMetadataMap.ModuleMetadata moduleMetadata, @Nullable String closureNamespace, boolean mutated)
extends Record
An
export
ed name in a module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
ThelocalName()
of anonymous ES module default exports, e.g.static final String
TheexportName()
of goog.module default exports, e.g. -
Constructor Summary
ConstructorsConstructorDescriptionExport
(@Nullable String exportName, @Nullable String moduleRequest, @Nullable String importName, @Nullable String localName, @Nullable ModuleLoader.ModulePath modulePath, @Nullable Node exportNode, @Nullable Node nameNode, ModuleMetadataMap.ModuleMetadata moduleMetadata, @Nullable String closureNamespace, boolean mutated) Creates an instance of aExport
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Returns the value of theclosureNamespace
record component.final boolean
Indicates whether some other object is "equal to" this one.@Nullable String
Returns the value of theexportName
record component.@Nullable Node
Returns the value of theexportNode
record component.final int
hashCode()
Returns a hash code value for this object.@Nullable String
Returns the value of theimportName
record component.@Nullable String
Returns the value of thelocalName
record component.Returns the value of themoduleMetadata
record component.@Nullable ModuleLoader.ModulePath
Returns the value of themodulePath
record component.@Nullable String
Returns the value of themoduleRequest
record component.boolean
mutated()
Returns the value of themutated
record component.@Nullable Node
nameNode()
Returns the value of thenameNode
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
DEFAULT_EXPORT_NAME
ThelocalName()
of anonymous ES module default exports, e.g.export default 0
.- See Also:
-
NAMESPACE
TheexportName()
of goog.module default exports, e.g.exports = class {};
, and the 'namespace' of an ES module consisting of all exported names.- See Also:
-
-
Constructor Details
-
Export
public Export(@Nullable String exportName, @Nullable String moduleRequest, @Nullable String importName, @Nullable String localName, @Nullable ModuleLoader.ModulePath modulePath, @Nullable Node exportNode, @Nullable Node nameNode, ModuleMetadataMap.ModuleMetadata moduleMetadata, @Nullable String closureNamespace, boolean mutated) Creates an instance of aExport
record class.- Parameters:
exportName
- the value for theexportName
record componentmoduleRequest
- the value for themoduleRequest
record componentimportName
- the value for theimportName
record componentlocalName
- the value for thelocalName
record componentmodulePath
- the value for themodulePath
record componentexportNode
- the value for theexportNode
record componentnameNode
- the value for thenameNode
record componentmoduleMetadata
- the value for themoduleMetadata
record componentclosureNamespace
- the value for theclosureNamespace
record componentmutated
- the value for themutated
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
exportName
Returns the value of theexportName
record component.- Returns:
- the value of the
exportName
record component
-
moduleRequest
Returns the value of themoduleRequest
record component.- Returns:
- the value of the
moduleRequest
record component
-
importName
Returns the value of theimportName
record component.- Returns:
- the value of the
importName
record component
-
localName
Returns the value of thelocalName
record component.- Returns:
- the value of the
localName
record component
-
modulePath
Returns the value of themodulePath
record component.- Returns:
- the value of the
modulePath
record component
-
exportNode
Returns the value of theexportNode
record component.- Returns:
- the value of the
exportNode
record component
-
nameNode
Returns the value of thenameNode
record component.- Returns:
- the value of the
nameNode
record component
-
moduleMetadata
Returns the value of themoduleMetadata
record component.- Returns:
- the value of the
moduleMetadata
record component
-
closureNamespace
Returns the value of theclosureNamespace
record component.- Returns:
- the value of the
closureNamespace
record component
-
mutated
public boolean mutated()Returns the value of themutated
record component.- Returns:
- the value of the
mutated
record component
-