Package com.google.debugging.sourcemap
Class SourceMapConsumerV3
- java.lang.Object
-
- com.google.debugging.sourcemap.SourceMapConsumerV3
-
- All Implemented Interfaces:
SourceMapConsumer,SourceMapping,SourceMappingReversable
public final class SourceMapConsumerV3 extends java.lang.Object implements SourceMapConsumer, SourceMappingReversable
Class for parsing version 3 of the SourceMap format, as produced by the Closure Compiler, etc. http://code.google.com/p/closure-compiler/wiki/SourceMaps
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSourceMapConsumerV3.EntryVisitor
-
Constructor Summary
Constructors Constructor Description SourceMapConsumerV3()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>getExtensions()Returns all extensions and their values (which can be any json value) in a Map object.com.google.debugging.sourcemap.proto.Mapping.OriginalMappinggetMappingForLine(int lineNumber, int column)Returns the original mapping for the line number and column position found in the source map.java.util.Collection<java.lang.String>getOriginalSources()java.util.Collection<java.lang.String>getOriginalSourcesContent()java.util.Collection<com.google.debugging.sourcemap.proto.Mapping.OriginalMapping>getReverseMapping(java.lang.String originalFile, int line, int column)Given a source file, line, and column, return the reverse mapping (source → target).java.lang.StringgetSourceRoot()voidparse(SourceMapObject sourceMapObject, SourceMapSupplier sectionSupplier)Parses the given contents containing a source map.voidparse(java.lang.String contents)Parses the given contents containing a source map.voidvisitMappings(SourceMapConsumerV3.EntryVisitor visitor)
-
-
-
Method Detail
-
parse
public void parse(java.lang.String contents) throws SourceMapParseExceptionParses the given contents containing a source map.- Specified by:
parsein interfaceSourceMapConsumer- Throws:
SourceMapParseException
-
parse
public void parse(SourceMapObject sourceMapObject, SourceMapSupplier sectionSupplier) throws SourceMapParseException
Parses the given contents containing a source map.- Throws:
SourceMapParseException
-
getMappingForLine
public com.google.debugging.sourcemap.proto.Mapping.OriginalMapping getMappingForLine(int lineNumber, int column)Description copied from interface:SourceMappingReturns the original mapping for the line number and column position found in the source map. Returns null if none is found.- Specified by:
getMappingForLinein interfaceSourceMapping- Parameters:
lineNumber- The line number, with the first being '1'.column- The column index, with the first being '1'.
-
getOriginalSources
public java.util.Collection<java.lang.String> getOriginalSources()
- Specified by:
getOriginalSourcesin interfaceSourceMappingReversable- Returns:
- the collection of original sources in this source mapping
-
getOriginalSourcesContent
public java.util.Collection<java.lang.String> getOriginalSourcesContent()
-
getReverseMapping
public java.util.Collection<com.google.debugging.sourcemap.proto.Mapping.OriginalMapping> getReverseMapping(java.lang.String originalFile, int line, int column)Description copied from interface:SourceMappingReversableGiven a source file, line, and column, return the reverse mapping (source → target). A collection is returned as in some cases (like a function being inlined), one source line may map to more then one target location. An empty collection is returned if there were no matches.- Specified by:
getReverseMappingin interfaceSourceMappingReversable- Parameters:
originalFile- the source fileline- the source linecolumn- the source column- Returns:
- the reverse mapping (source → target)
-
getSourceRoot
public java.lang.String getSourceRoot()
-
getExtensions
public java.util.Map<java.lang.String,java.lang.Object> getExtensions()
Returns all extensions and their values (which can be any json value) in a Map object.- Returns:
- The extension list
-
visitMappings
public void visitMappings(SourceMapConsumerV3.EntryVisitor visitor)
-
-