Class SourceMapWriter
java.lang.Object
de.inetsoftware.jwebassembly.sourcemap.SourceMapWriter
Generates Source Map version 3.
https://sourcemaps.info/spec.html
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classThe generator of the source map -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<SourceMapping> private intprivate final LinkedHashMap<String, Integer> private final String -
Constructor Summary
ConstructorsConstructorDescriptionSourceMapWriter(String sourceRoot) Create a new instance of the writer for a single map file. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMapping(SourceMapping mapping) Adds a mapping for the given node.private static voidappendJsonField(Appendable out, String name, CharSequence value) Write the field name to JSON source map.private static voidappendQuoteString(Appendable out, String str) Write a quoted string to the JSON.private voidWrite source file names.voidgenerate(Appendable out) https://sourcemaps.info/spec.html
-
Field Details
-
sourceRoot
-
mappings
-
sourceFileNames
-
nextSourceFileNameIndex
private int nextSourceFileNameIndex
-
-
Constructor Details
-
SourceMapWriter
-
-
Method Details
-
addMapping
Adds a mapping for the given node. Mappings must be added in order.- Parameters:
mapping- the mapping
-
generate
https://sourcemaps.info/spec.html- Parameters:
out- the target- Throws:
IOException- if any I/O error occur
-
appendSourceFileNames
Write source file names.- Parameters:
out- the target- Throws:
IOException- if any I/O error occur
-
appendJsonField
private static void appendJsonField(Appendable out, String name, CharSequence value) throws IOException Write the field name to JSON source map.- Parameters:
out- the targetname- the field namevalue- optional value- Throws:
IOException- if any I/O error occur
-
appendQuoteString
Write a quoted string to the JSON.- Parameters:
out- the targetstr- the unquoted string- Throws:
IOException- if any I/O error occur
-