Package org.ec4j.core
Class ResourcePropertiesService.Builder
java.lang.Object
org.ec4j.core.ResourcePropertiesService.Builder
- Enclosing class:
ResourcePropertiesService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Cacheprivate Stringprivate List<EditorConfig> private booleanprivate EditorConfigLoaderprivate Set<ResourcePath> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Sets the cache implementationconfigFileName(String configFileName) Sets the file name to consider as an.editorconfigfile.defaultEditorConfig(EditorConfig defaultEditorConfig) Adds a singleEditorConfigmodel that contains default settings beyond the ones set in the filesystem.defaultEditorConfigs(Collection<EditorConfig> defaultEditorConfigs) Adds multipleEditorConfigmodels that contain default settings beyond the ones set in the filesystem.defaultEditorConfigs(EditorConfig... defaultEditorConfigs) Adds multipleEditorConfigmodels that contain default settings beyond the ones set in the filesystem.keepUnset(boolean keepUnset) When set totruethePropertys with theunsetvalue will be kept in theResourcePropertiesreturned byResourcePropertiesService.queryProperties(Resource); otherwise thePropertys with theunsetvalue will be removed from theResourcePropertiesreturned byResourcePropertiesService.queryProperties(Resource).loader(EditorConfigLoader loader) Sets theEditorConfigLoaderrootDirectories(Collection<ResourcePath> rootDirectories) Adds multiple root directoriesrootDirectories(ResourcePath... rootDirectories) Adds multiple root directoriesrootDirectory(ResourcePath rootDirectory) Adds a single root directory
-
Field Details
-
cache
-
configFileName
-
defaultEditorConfigs
-
keepUnset
private boolean keepUnset -
loader
-
rootDirectories
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
-
cache
Sets the cache implementation- Parameters:
cache- the Cache to set- Returns:
- this
ResourcePropertiesService.Builder
-
configFileName
Sets the file name to consider as an.editorconfigfile.- Parameters:
configFileName- an alternative name.editorconfigfile name- Returns:
- this
ResourcePropertiesService.Builder
-
defaultEditorConfig
Adds a singleEditorConfigmodel that contains default settings beyond the ones set in the filesystem. This can be used to implement user or system defaults. Note several default files can be added. In such a case the order of adding matters: the file added as the last one will least significant. In other words, you should add user defaults before system defaults.- Parameters:
defaultEditorConfig- the defaultEditorConfigmodel to add- Returns:
- this
ResourcePropertiesService.Builder
-
defaultEditorConfigs
public ResourcePropertiesService.Builder defaultEditorConfigs(Collection<EditorConfig> defaultEditorConfigs) Adds multipleEditorConfigmodels that contain default settings beyond the ones set in the filesystem. This can be used to implement user or system defaults. The order of the added files matters: the file added as the last one will be least significant. In other words, you should add user defaults before system defaults.- Parameters:
defaultEditorConfigs- a collection of defaultEditorConfigmodels to add- Returns:
- this
ResourcePropertiesService.Builder
-
defaultEditorConfigs
Adds multipleEditorConfigmodels that contain default settings beyond the ones set in the filesystem. This can be used to implement user or system defaults. The order of the added files matters: the file added as the last one will be least significant. In other words, you should add user defaults before system defaults.- Parameters:
defaultEditorConfigs- defaultEditorConfigmodels to add- Returns:
- this
ResourcePropertiesService.Builder
-
keepUnset
When set totruethePropertys with theunsetvalue will be kept in theResourcePropertiesreturned byResourcePropertiesService.queryProperties(Resource); otherwise thePropertys with theunsetvalue will be removed from theResourcePropertiesreturned byResourcePropertiesService.queryProperties(Resource).- Parameters:
keepUnset- see above- Returns:
- this
ResourcePropertiesService.Builder
-
loader
Sets theEditorConfigLoader- Parameters:
loader- theEditorConfigLoaderto set- Returns:
- this
ResourcePropertiesService.Builder
-
rootDirectories
Adds multiple root directories- Parameters:
rootDirectories- the root directories to add- Returns:
- this
ResourcePropertiesService.Builder
-
rootDirectories
Adds multiple root directories- Parameters:
rootDirectories- the root directories to add- Returns:
- this
ResourcePropertiesService.Builder
-
rootDirectory
Adds a single root directory- Parameters:
rootDirectory- the root directory to add- Returns:
- this
ResourcePropertiesService.Builder
-