类 JavaInput
java.lang.Object
com.palantir.javaformat.InputOutput
com.palantir.javaformat.Input
com.palantir.javaformat.java.JavaInput
JavaInput extends Input to represent a Java input document.-
字段概要
从类继承的字段 com.palantir.javaformat.InputOutput
EMPTY_RANGE, ranges -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明com.google.common.collect.RangeSet<Integer> characterRangesToTokenRanges(Collection<com.google.common.collect.Range<Integer>> characterRanges) intgetColumnNumber(int inputPosition) Converts a character offset in the input to a 0-based column number.intgetLineNumber(int inputPosition) Converts a character offset in the input to a line number.com.google.common.collect.ImmutableRangeMap<Integer, com.palantir.javaformat.java.JavaInput.Token> Get the navigable map from position toJavaInput.Token.getText()Get the input text.com.google.common.collect.ImmutableList<? extends Input.Token> Get the input tokens.voidsetCompilationUnit(com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit) toString()从类继承的方法 com.palantir.javaformat.Input
createDiagnostic从类继承的方法 com.palantir.javaformat.InputOutput
computeRanges, getLine, getLineCount, getRanges, makeKToIJ, setLines
-
构造器详细资料
-
JavaInput
Input constructor.- 参数:
text- the input text- 抛出:
com.palantir.javaformat.java.FormatterException- if the input cannot be parsed
-
-
方法详细资料
-
getText
Get the input text. -
getPositionToColumnMap
- 指定者:
getPositionToColumnMap在类中Input
-
getLineSeparator
-
getTokens
Get the input tokens. -
getPositionTokenMap
public com.google.common.collect.ImmutableRangeMap<Integer,com.palantir.javaformat.java.JavaInput.Token> getPositionTokenMap()Get the navigable map from position toJavaInput.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在类中Input- 返回:
- the navigable map from position to
JavaInput.Token
-
toString
-
getLineNumber
public int getLineNumber(int inputPosition) 从类复制的说明:InputConverts a character offset in the input to a line number.- 指定者:
getLineNumber在类中Input
-
getColumnNumber
public int getColumnNumber(int inputPosition) 从类复制的说明:InputConverts a character offset in the input to a 0-based column number.- 指定者:
getColumnNumber在类中Input
-
setCompilationUnit
public void setCompilationUnit(com.sun.tools.javac.tree.JCTree.JCCompilationUnit unit) -
characterRangesToTokenRanges
public com.google.common.collect.RangeSet<Integer> characterRangesToTokenRanges(Collection<com.google.common.collect.Range<Integer>> characterRanges) throws com.palantir.javaformat.java.FormatterException - 抛出:
com.palantir.javaformat.java.FormatterException
-