Package io.spring.javaformat.config
Interface JavaFormatConfig
-
public interface JavaFormatConfigSupport for the.springjavaformatconfigfile that can be used to apply settings on a per-project basis.- Author:
- Phillip Webb
-
-
Field Summary
Fields Modifier and Type Field Description static JavaFormatConfigDEFAULTThe defaultJavaFormatConfig.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static JavaFormatConfigfindFrom(File file)Find and load a.springjavaformatconfigby searching from the given file.static JavaFormatConfigfindFrom(Path path)Find and load a.springjavaformatconfigby searching from the given file.IndentationStylegetIndentationStyle()Return the indentation style that should be used with the project.JavaBaselinegetJavaBaseline()Java JDK baseline version expected be used when formatting.static JavaFormatConfigload(File file)Load aJavaFormatConfigfrom the given file.static JavaFormatConfigload(InputStream inputStream)Load aJavaFormatConfigfrom the given input stream.static JavaFormatConfigof(JavaBaseline javaBaseline, IndentationStyle indentationStyle)Factory method to create aJavaFormatConfigwith specific settings.
-
-
-
Field Detail
-
DEFAULT
static final JavaFormatConfig DEFAULT
The defaultJavaFormatConfig.
-
-
Method Detail
-
getJavaBaseline
JavaBaseline getJavaBaseline()
Java JDK baseline version expected be used when formatting.- Returns:
- the JDK version
-
getIndentationStyle
IndentationStyle getIndentationStyle()
Return the indentation style that should be used with the project.- Returns:
- the indentation style
-
findFrom
static JavaFormatConfig findFrom(Path path)
Find and load a.springjavaformatconfigby searching from the given file.- Parameters:
path- the file or directory to search from- Returns:
- a loaded
JavaFormatConfigorDEFAULTif no.springjavaformatconfigfile is found
-
findFrom
static JavaFormatConfig findFrom(File file)
Find and load a.springjavaformatconfigby searching from the given file.- Parameters:
file- the file or directory to search from- Returns:
- a loaded
JavaFormatConfigorDEFAULTif no.springjavaformatconfigfile is found
-
load
static JavaFormatConfig load(File file)
Load aJavaFormatConfigfrom the given file.- Parameters:
file- the file to load- Returns:
- the loaded config
-
load
static JavaFormatConfig load(InputStream inputStream)
Load aJavaFormatConfigfrom the given input stream.- Parameters:
inputStream- the input stream to load- Returns:
- the loaded config
-
of
static JavaFormatConfig of(JavaBaseline javaBaseline, IndentationStyle indentationStyle)
Factory method to create aJavaFormatConfigwith specific settings.- Parameters:
javaBaseline- The baseline JDK versionindentationStyle- the indentation style- Returns:
- a
JavaFormatConfiginstance
-
-