Modifier and Type | Method and Description |
---|---|
java.lang.String |
content()
Obtains the value of the line.
|
static Import |
fileRelativeTo(io.spine.code.fs.js.FileName fileToImport,
io.spine.code.fs.js.FileName relativeTo)
Obtains an import of a file relative to another file.
|
static Import |
fileRelativeToRoot(io.spine.code.fs.js.FileName file)
Obtains an import of a file assuming the name is relative to the current directory.
|
static Import |
library(java.lang.String libraryName)
Obtains an import of a library.
|
java.lang.String |
namedAs(java.lang.String importName)
Obtains the named version of the import.
|
Import |
toDefault()
Converts the import to the default import.
|
public static Import fileRelativeToRoot(io.spine.code.fs.js.FileName file)
public static Import fileRelativeTo(io.spine.code.fs.js.FileName fileToImport, io.spine.code.fs.js.FileName relativeTo)
fileToImport
- the name of the file to importrelativeTo
- the name of the file to compose the relative import pathpublic static Import library(java.lang.String libraryName)
It is allowed to specify just a library name like google-protobuf
or the path to a library file, e.g. google-protobuf/proto-file.js
.
public java.lang.String content()
CodeLine
public Import toDefault()
Does nothing if the import is already default.
public java.lang.String namedAs(java.lang.String importName)
importName
- the name for the import