| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.google.debugging.sourcemap; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
public class SourceMapSection { |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
private final String value; |
| 30 |
private final int line; |
| 31 |
private final int column; |
| 32 |
private final SectionType type; |
| 33 |
|
| 34 |
public static enum SectionType { |
| 35 |
URL, |
| 36 |
MAP |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
@Deprecated |
| 48 |
public SourceMapSection(String sectionUrl, int line, int column) { |
| 49 |
this.type = SectionType.URL; |
| 50 |
this.value = sectionUrl; |
| 51 |
this.line = line; |
| 52 |
this.column = column; |
| 53 |
} |
| 54 |
|
| 55 |
private SourceMapSection( |
| 56 |
SectionType type, String value, int line, int column) { |
| 57 |
this.type = type; |
| 58 |
this.value = value; |
| 59 |
this.line = line; |
| 60 |
this.column = column; |
| 61 |
} |
| 62 |
|
| 63 |
public static SourceMapSection forMap(String value, int line, int column) { |
| 64 |
return new SourceMapSection(SectionType.MAP, value, line, column); |
| 65 |
} |
| 66 |
|
| 67 |
public static SourceMapSection forURL(String value, int line, int column) { |
| 68 |
return new SourceMapSection(SectionType.URL, value, line, column); |
| 69 |
} |
| 70 |
|
| 71 |
public SectionType getSectionType() { |
| 72 |
return this.type; |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
@Deprecated |
| 80 |
public String getSectionUrl() { |
| 81 |
assert(type.equals(SectionType.URL)); |
| 82 |
return value; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
public String getSectionValue() { |
| 89 |
return value; |
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
public int getLine() { |
| 96 |
return line; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
public int getColumn() { |
| 103 |
return column; |
| 104 |
} |
| 105 |
} |