Class PathGenerator
java.lang.Object
cc.carm.lib.configuration.source.loader.PathGenerator
Path generator for configuration.
Path generator is a utility class that helps to generate the path of the configuration. It can be used to generate the path of the field or class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncovertPath
(String name) static String
covertPathName
(String name) Get the configuration name of the specified element.@Nullable String
getClassPath
(@NotNull ConfigurationHolder<?> holder, @Nullable String parentPath, @NotNull Class<?> clazz, @Nullable Field clazzField) @Nullable String
getFieldPath
(@NotNull ConfigurationHolder<?> holder, @Nullable String parentPath, @NotNull Field field) @NotNull UnaryOperator
<String> static boolean
protected @Nullable String
link
(@NotNull ConfigurationHolder<?> holder, @Nullable String parent, boolean root, @Nullable String path) static PathGenerator
of()
static PathGenerator
of
(UnaryOperator<String> pathConverter) static char
pathSeparator
(ConfigurationHolder<?> holder) protected String
void
setPathConverter
(UnaryOperator<String> pathConverter)
-
Field Details
-
pathConverter
-
-
Constructor Details
-
PathGenerator
-
-
Method Details
-
of
-
of
-
getPathConverter
-
setPathConverter
-
covertPath
-
getFieldPath
@Nullable public @Nullable String getFieldPath(@NotNull @NotNull ConfigurationHolder<?> holder, @Nullable @Nullable String parentPath, @NotNull @NotNull Field field) -
getClassPath
@Nullable public @Nullable String getClassPath(@NotNull @NotNull ConfigurationHolder<?> holder, @Nullable @Nullable String parentPath, @NotNull @NotNull Class<?> clazz, @Nullable @Nullable Field clazzField) -
select
-
link
@Nullable protected @Nullable String link(@NotNull @NotNull ConfigurationHolder<?> holder, @Nullable @Nullable String parent, boolean root, @Nullable @Nullable String path) -
isBlank
-
pathSeparator
-
covertPathName
Get the configuration name of the specified element. Use the naming convention of all lowercase and "-" links.e.g. "SOME_NAME" will be "some-name"
- Parameters:
name
- source name- Returns:
- the final path
-