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 {} fromorexport * 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
exported name in a module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThelocalName()of anonymous ES module default exports, e.g.static final StringTheexportName()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 aExportrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of theclosureNamespacerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable StringReturns the value of theexportNamerecord component.@Nullable NodeReturns the value of theexportNoderecord component.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of theimportNamerecord component.@Nullable StringReturns the value of thelocalNamerecord component.Returns the value of themoduleMetadatarecord component.@Nullable ModuleLoader.ModulePathReturns the value of themodulePathrecord component.@Nullable StringReturns the value of themoduleRequestrecord component.booleanmutated()Returns the value of themutatedrecord component.@Nullable NodenameNode()Returns the value of thenameNoderecord component.final StringtoString()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 aExportrecord class.- Parameters:
exportName- the value for theexportNamerecord componentmoduleRequest- the value for themoduleRequestrecord componentimportName- the value for theimportNamerecord componentlocalName- the value for thelocalNamerecord componentmodulePath- the value for themodulePathrecord componentexportNode- the value for theexportNoderecord componentnameNode- the value for thenameNoderecord componentmoduleMetadata- the value for themoduleMetadatarecord componentclosureNamespace- the value for theclosureNamespacerecord componentmutated- the value for themutatedrecord 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 theexportNamerecord component.- Returns:
- the value of the
exportNamerecord component
-
moduleRequest
Returns the value of themoduleRequestrecord component.- Returns:
- the value of the
moduleRequestrecord component
-
importName
Returns the value of theimportNamerecord component.- Returns:
- the value of the
importNamerecord component
-
localName
Returns the value of thelocalNamerecord component.- Returns:
- the value of the
localNamerecord component
-
modulePath
Returns the value of themodulePathrecord component.- Returns:
- the value of the
modulePathrecord component
-
exportNode
Returns the value of theexportNoderecord component.- Returns:
- the value of the
exportNoderecord component
-
nameNode
Returns the value of thenameNoderecord component.- Returns:
- the value of the
nameNoderecord component
-
moduleMetadata
Returns the value of themoduleMetadatarecord component.- Returns:
- the value of the
moduleMetadatarecord component
-
closureNamespace
Returns the value of theclosureNamespacerecord component.- Returns:
- the value of the
closureNamespacerecord component
-
mutated
public boolean mutated()Returns the value of themutatedrecord component.- Returns:
- the value of the
mutatedrecord component
-