EMPTY_RANGE, range0s, range1s, ranges| Constructor and Description |
|---|
JavaInput(String filename,
String text)
Input constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
filename()
The input filename.
|
int |
getColumnNumber(int inputPosition)
Converts a character offset in the input to a 0-based column number.
|
int |
getLineNumber(int inputPosition)
Converts a character offset in the input to a line number.
|
ImmutableMap<Integer,Integer> |
getPositionToColumnMap() |
NavigableMap<Integer,com.google.googlejavaformat.java.JavaInput.Token> |
getPositionTokenMap()
Get the navigable map from position to
Token. |
String |
getText()
Get the input text.
|
ImmutableList<? extends Input.Token> |
getTokens()
Get the input tokens.
|
void |
setCompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit unit) |
String |
toString() |
createDiagnosticcomputeRanges, getLine, getLineCount, getRange0s, getRange1s, getRanges, makeKToIJ, setLinespublic JavaInput(String filename, String text) throws FormatterException
text - the input textFormatterException - if the input cannot be parsedpublic String getText()
public ImmutableMap<Integer,Integer> getPositionToColumnMap()
getPositionToColumnMap in class Inputpublic ImmutableList<? extends Input.Token> getTokens()
public NavigableMap<Integer,com.google.googlejavaformat.java.JavaInput.Token> getPositionTokenMap()
Token. Used to look for tokens following a given
one, and to implement the --offset and --length flags to reformat a character range in the
input file.getPositionTokenMap in class InputTokenpublic int getLineNumber(int inputPosition)
InputgetLineNumber in class Inputpublic int getColumnNumber(int inputPosition)
InputgetColumnNumber in class Inputpublic void setCompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit unit)
Copyright © 2015–2016 Google Inc.. All rights reserved.