Class PathGenerator

java.lang.Object
cc.carm.lib.configuration.source.loader.PathGenerator

public class PathGenerator extends Object
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 Details

  • Constructor Details

  • Method Details

    • of

      public static PathGenerator of()
    • of

      public static PathGenerator of(UnaryOperator<String> pathConverter)
    • getPathConverter

      @NotNull public @NotNull UnaryOperator<String> getPathConverter()
    • setPathConverter

      public void setPathConverter(UnaryOperator<String> pathConverter)
    • covertPath

      public String covertPath(String name)
    • 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

      protected String select(String path, String defaultValue)
    • link

      @Nullable protected @Nullable String link(@NotNull @NotNull ConfigurationHolder<?> holder, @Nullable @Nullable String parent, boolean root, @Nullable @Nullable String path)
    • isBlank

      public static boolean isBlank(String path)
    • pathSeparator

      public static char pathSeparator(ConfigurationHolder<?> holder)
    • covertPathName

      public static String covertPathName(String name)
      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