public final class SourceMapGeneratorV3 extends Object implements SourceMapGenerator
SourceMapGeneratorV3
Constructor and Description |
---|
SourceMapGeneratorV3() |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(String sourceName,
String symbolName,
FilePosition sourceStartPosition,
FilePosition outputStartPosition,
FilePosition outputEndPosition)
Adds a mapping for the given node.
|
void |
appendIndexMapTo(Appendable out,
String name,
List<SourceMapSection> sections)
Appends the index source map to the given buffer.
|
void |
appendTo(Appendable out,
String name)
Appends the source map to the given buffer.
|
void |
reset()
Resets the source map for reuse.
|
void |
setStartingPosition(int offsetLine,
int offsetIndex)
Sets the source code that exists in the buffer for which the
generated code is being generated.
|
void |
setWrapperPrefix(String prefix)
Sets the prefix used for wrapping the generated source file before
it is written.
|
void |
validate(boolean validate)
Whether to perform additional validation on the source map.
|
public void appendTo(Appendable out, String name) throws IOException
SourceMapGenerator
appendTo
in interface SourceMapGenerator
out
- The stream to which the map will be appended.name
- The name of the generated source file that this source map
represents.IOException
public void appendIndexMapTo(Appendable out, String name, List<SourceMapSection> sections) throws IOException
SourceMapGenerator
appendIndexMapTo
in interface SourceMapGenerator
out
- The stream to which the map will be appended.name
- The name of the generated source file that this source map
represents.sections
- An ordered list of map sections to include in the index.IOException
public void reset()
SourceMapGenerator
reset
in interface SourceMapGenerator
public void addMapping(String sourceName, String symbolName, FilePosition sourceStartPosition, FilePosition outputStartPosition, FilePosition outputEndPosition)
SourceMapGenerator
addMapping
in interface SourceMapGenerator
sourceName
- The file name to use in the generate source map
to represent this source.symbolName
- The symbol name associated with this position in the
source map.sourceStartPosition
- The starting position in the original source for
represented range outputStartPosition to outputEndPosition in the
generated file.outputStartPosition
- The position on the starting lineoutputEndPosition
- The position on the ending line.public void setWrapperPrefix(String prefix)
SourceMapGenerator
setWrapperPrefix
in interface SourceMapGenerator
prefix
- The prefix that is added before the generated source code.public void setStartingPosition(int offsetLine, int offsetIndex)
SourceMapGenerator
setStartingPosition
in interface SourceMapGenerator
offsetLine
- The index of the current line being printed.offsetIndex
- The column index of the current character being printed.public void validate(boolean validate)
SourceMapGenerator
validate
in interface SourceMapGenerator
Copyright © 2009–2023 Google. All rights reserved.