Package com.palantir.javaformat.java
Class JavaOutput
java.lang.Object
com.palantir.javaformat.InputOutput
com.palantir.javaformat.Output
com.palantir.javaformat.java.JavaOutput
JavaOutput extends Output to represent a Java output document. It includes methods to emit the
output document.-
Field Summary
Fields inherited from class com.palantir.javaformat.InputOutput
EMPTY_RANGE, ranges -
Constructor Summary
ConstructorsConstructorDescriptionJavaOutput(JavaInput javaInput, InputMetadata inputMetadata) JavaOutputconstructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidOutput a string.static Input.TokendTok(Input.Token token) The last non-whitespace Tok in the Token.com.google.common.collect.ImmutableList<com.palantir.javaformat.java.Replacement>getFormatReplacements(com.google.common.collect.RangeSet<Integer> iRangeSet0) Emit a list ofReplacements to convert from input to output.voidindent(int indent) Indent by outputtingindentspaces.static intstartPosition(Input.Token token) The earliest position of any Tok in the Token, including leading whitespace.static Input.TokstartTok(Input.Token token) The earliest non-whitespace Tok in the Token.toString()Methods inherited from class com.palantir.javaformat.InputOutput
computeRanges, getLine, getLineCount, getRanges, makeKToIJ, setLines
-
Constructor Details
-
JavaOutput
JavaOutputconstructor.- Parameters:
javaInput- theJavaInput, used to match up blank lines in the output
-
-
Method Details
-
append
Description copied from class:OutputOutput a string. -
indent
public void indent(int indent) Description copied from class:OutputIndent by outputtingindentspaces. -
getFormatReplacements
public com.google.common.collect.ImmutableList<com.palantir.javaformat.java.Replacement> getFormatReplacements(com.google.common.collect.RangeSet<Integer> iRangeSet0) Emit a list ofReplacements to convert from input to output.- Returns:
- a list of
Replacements, sorted by start index, without overlaps
-
startPosition
The earliest position of any Tok in the Token, including leading whitespace. -
startTok
The earliest non-whitespace Tok in the Token. -
endTok
The last non-whitespace Tok in the Token. -
toString
-