Class GoogleJavaFormatterWrapper
java.lang.Object
de.funfried.netbeans.plugins.external.formatter.java.google.GoogleJavaFormatterWrapper
Delegation class to the Google formatter implementation.
- Author:
- bahlef
-
Method Summary
Modifier and TypeMethodDescriptionformat
(String code, JavaFormatterOptions.Style codeStyle, SortedSet<Pair<Integer, Integer>> changedElements) Formats the givencode
with the given configurations and returns the formatted code.organizeImports
(String code, JavaFormatterOptions.Style codeStyle)
-
Method Details
-
format
@CheckForNull public String format(String code, JavaFormatterOptions.Style codeStyle, SortedSet<Pair<Integer, Integer>> changedElements) throws FormattingFailedExceptionFormats the givencode
with the given configurations and returns the formatted code.- Parameters:
code
- the unformatted codecodeStyle
- the codeJavaFormatterOptions.Style
to use, ifnull
theJavaFormatterOptions.Style.GOOGLE
style will be usedchangedElements
- aSortedSet
containing ranges asPair
objects defining the offsets which should be formatted- Returns:
- the formatted code
- Throws:
FormattingFailedException
- if the external formatter failed to format the given code
-
organizeImports
@CheckForNull public String organizeImports(String code, JavaFormatterOptions.Style codeStyle) throws FormattingFailedException - Throws:
FormattingFailedException
-