public class NullSourceSection extends java.lang.Object implements SourceSection
SourceSection
that represents unavailable source, e.g. for language
builtins.Constructor and Description |
---|
NullSourceSection(java.lang.String kind,
java.lang.String name)
Placeholder for source that is unavailable, e.g.
|
NullSourceSection(java.lang.String kind,
java.lang.String name,
java.lang.String asCode)
Placeholder for source that is unavailable, e.g.
|
Modifier and Type | Method and Description |
---|---|
int |
getCharEndIndex()
Returns the index of the text position immediately following the last character in the
section.
|
int |
getCharIndex()
Returns the 0-based index of the first character in this section.
|
int |
getCharLength()
Returns the length of this section in characters.
|
java.lang.String |
getCode()
Returns text described by this section.
|
java.lang.String |
getIdentifier()
Returns terse text describing this source section, typically used for printing the section.
|
LineLocation |
getLineLocation()
Gets a representation of the first line of the section, suitable for a hash key.
|
java.lang.String |
getShortDescription()
Returns a short description of the source section, using just the file name, rather than its
full path.
|
Source |
getSource()
Representation of the source program that contains this section.
|
int |
getStartColumn()
Returns the 1-based column number of the first character in this section (inclusive).
|
int |
getStartLine()
Returns 1-based line number of the first character in this section (inclusive).
|
java.lang.String |
toString() |
public NullSourceSection(java.lang.String kind, java.lang.String name)
kind
- the general category, e.g. "JS builtin"name
- specific name for this sectionpublic NullSourceSection(java.lang.String kind, java.lang.String name, java.lang.String asCode)
kind
- the general category, e.g. "JS builtin"name
- specific name for this sectionasCode
- string to return when getCode()
is calledpublic final Source getSource()
SourceSection
getSource
in interface SourceSection
public final int getStartLine()
SourceSection
getStartLine
in interface SourceSection
public final LineLocation getLineLocation()
SourceSection
getLineLocation
in interface SourceSection
public final int getStartColumn()
SourceSection
getStartColumn
in interface SourceSection
public final int getCharIndex()
SourceSection
getCharIndex
in interface SourceSection
public final int getCharLength()
SourceSection
getCharLength
in interface SourceSection
public final int getCharEndIndex()
SourceSection
getCharEndIndex
in interface SourceSection
public final java.lang.String getIdentifier()
SourceSection
getIdentifier
in interface SourceSection
public final java.lang.String getCode()
SourceSection
getCode
in interface SourceSection
public final java.lang.String getShortDescription()
SourceSection
getShortDescription
in interface SourceSection
public java.lang.String toString()
toString
in class java.lang.Object