public class DiagnosticSource extends Object
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Field and Description |
---|---|
protected char[] |
buf
A temporary hard reference to the content of the file object.
|
protected int |
bufLen
The length of the content.
|
protected EndPosTable |
endPosTable |
protected JavaFileObject |
fileObject
The underlying file object.
|
protected int |
line
The line number of a line found by findLine.
|
protected int |
lineStart
The start of a line found by findLine.
|
protected AbstractLog |
log
A log for reporting errors, such as errors accessing the content.
|
static DiagnosticSource |
NO_SOURCE |
protected SoftReference<char[]> |
refBuf
A soft reference to the content of the file object.
|
Constructor and Description |
---|
DiagnosticSource(JavaFileObject fo,
AbstractLog log) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
findLine(int pos)
Find the line in the buffer that contains the current position
|
int |
getColumnNumber(int pos,
boolean expandTabs)
Return the one-based column number associated with a given pos
for the current source file.
|
EndPosTable |
getEndPosTable() |
JavaFileObject |
getFile()
Return the underlying file object handled by this
DiagnosticSource object.
|
String |
getLine(int pos)
Return the content of the line containing a given pos.
|
int |
getLineNumber(int pos)
Return the one-based line number associated with a given pos
for the current source file.
|
protected char[] |
initBuf(JavaFileObject fileObject) |
void |
setEndPosTable(EndPosTable t) |
public static final DiagnosticSource NO_SOURCE
protected JavaFileObject fileObject
protected EndPosTable endPosTable
protected SoftReference<char[]> refBuf
protected char[] buf
protected int bufLen
protected int lineStart
protected int line
protected AbstractLog log
public DiagnosticSource(JavaFileObject fo, AbstractLog log)
public JavaFileObject getFile()
public int getLineNumber(int pos)
public int getColumnNumber(int pos, boolean expandTabs)
public String getLine(int pos)
public EndPosTable getEndPosTable()
public void setEndPosTable(EndPosTable t)
protected boolean findLine(int pos)
pos
- Character offset into the bufferprotected char[] initBuf(JavaFileObject fileObject) throws IOException
IOException
Copyright © 2015. All rights reserved.