public class JavaExtension extends FormatExtension
steps, target| Constructor and Description |
|---|
JavaExtension(SpotlessExtension rootExtension) |
| Modifier and Type | Method and Description |
|---|---|
void |
eclipseFormatFile(Object eclipseFormatFile) |
void |
eclipseFormatFile(String eclipseVersion,
Object eclipseFormatFile) |
void |
googleJavaFormat()
Uses the google-java-format jar to format source code.
|
void |
googleJavaFormat(String version)
Uses the given version of google-java-format to format source code.
|
void |
importOrder(List<String> importOrder) |
void |
importOrderFile(Object importOrderFile) |
void |
licenseHeader(String licenseHeader) |
void |
licenseHeaderFile(Object licenseHeaderFile) |
void |
removeUnusedImports()
Removes any unused imports.
|
protected void |
setupTask(SpotlessTask task)
If the user hasn’t specified the files yet, we’ll assume he/she means all of the java files.
|
addStep, bumpThisNumberIfACustomStepChanges, clearSteps, custom, custom, customLazy, customLazyGroovy, encoding, endWithNewline, getEncoding, getExistingStep, getLineEndings, getProject, ignoreErrorForPath, ignoreErrorForStep, indentWithSpaces, indentWithSpaces, indentWithTabs, indentWithTabs, licenseHeader, licenseHeaderFile, paddedCell, paddedCell, parseTarget, replace, replaceRegex, replaceStep, setEncoding, setEncoding, setLineEndings, target, trimTrailingWhitespacepublic JavaExtension(SpotlessExtension rootExtension)
public void licenseHeader(String licenseHeader)
public void licenseHeaderFile(Object licenseHeaderFile)
public void importOrderFile(Object importOrderFile)
public void eclipseFormatFile(Object eclipseFormatFile)
public void removeUnusedImports()
Removes any unused imports.
public void googleJavaFormat()
Uses the google-java-format jar to format source code.
public void googleJavaFormat(String version)
Uses the given version of google-java-format to format source code.
Limited to published versions. See issue #33 for an workaround for using snapshot versions.
protected void setupTask(SpotlessTask task)
If the user hasn’t specified the files yet, we’ll assume he/she means all of the java files.
setupTask in class FormatExtension