Package org.aoju.bus.setting
Class Builder
java.lang.Object
org.aoju.bus.setting.Builder
构建器创建
IniSetting示例
非线程安全- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacesection create functionstatic interfaceproperty create functionstatic interfacesection create function -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()commentCreator(Builder.IniCommentCreator iniCommentCreator) 设置评论创建者功能static void将Bean对象或者Map写出到Writerstatic void将Bean对象或者Map写出到Writerstatic PropertiesgetProperties(String name) 获取当前环境下的配置文件 name可以为不包括扩展名的文件名(默认.properties),也可以是文件名全称static <T> Tload(InputStream in, Class<T> type) 从流中加载YAMLstatic org.aoju.bus.core.lang.Dictionary加载YAML,加载完毕后关闭Readerstatic <T> T加载YAML,加载完毕后关闭Readerstatic <T> T加载YAMLstatic org.aoju.bus.core.lang.Dictionary从classpath或绝对路径加载YAML文件static <T> T从classpath或绝对路径加载YAML文件static voidparsePropsMap(Map<String, Object> result, String content) 解析PROPSstatic void解析YAMLstatic voidparseYamlMap(Map<String, Object> result, String content) 解析YAMLplus(List<IniElement> elements) Plus iniElement listPlus other builderplusComment(String value) plusProperties(Properties properties) Plus propertiesplusProperties(Properties properties, String commentValue) Plus propertiesplusProperties(Properties properties, IniComment comment) Plus propertiesplusProperty(String key, String value) Plus a propertyplusProperty(String key, String value, String commentValue) Plus a propertyplusProperty(String key, String value, IniComment comment) Plus a propertyplusSection(String value) Plus a sectionplusSection(String value, String commentValue) Plus a section with commentplusSection(String value, IniComment comment) Plus a section with commentpropertyCreator(Builder.IniPropertyCreator iniPropertyCreator) 设置属性创建器功能static StringreplaceRefValue(Properties properties, String value) 替换本地变量占位符sectionCreator(Builder.IniSectionCreator iniSectionCreator) 设置分区创建者功能skipLine(int length) 跳过线,向行添加空值
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
getProperties
获取当前环境下的配置文件 name可以为不包括扩展名的文件名(默认.properties),也可以是文件名全称- Parameters:
name- 文件名,如果没有扩展名,默认为.properties- Returns:
- 当前环境下配置文件
-
load
从classpath或绝对路径加载YAML文件- Parameters:
path- YAML路径,相对路径相对classpath- Returns:
- 加载的内容,默认Map
-
load
从classpath或绝对路径加载YAML文件- Type Parameters:
T- Bean类型,默认map- Parameters:
path- YAML路径,相对路径相对classpathtype- 加载的Bean类型,即转换为的bean- Returns:
- 加载的内容,默认Map
-
load
从流中加载YAML- Type Parameters:
T- Bean类型,默认map- Parameters:
in- 流type- 加载的Bean类型,即转换为的bean- Returns:
- 加载的内容,默认Map
-
load
加载YAML,加载完毕后关闭Reader- Parameters:
reader-Reader- Returns:
- 加载的Map
-
load
加载YAML,加载完毕后关闭Reader- Type Parameters:
T- Bean类型,默认map- Parameters:
reader-Readertype- 加载的Bean类型,即转换为的bean- Returns:
- 加载的内容,默认Map
-
load
加载YAML -
parsePropsMap
解析PROPS- Parameters:
result- 数据结果content- 数据内容
-
parseYamlMap
解析YAML- Parameters:
result- 数据结果content- 数据内容
-
parseYamlMap
public static void parseYamlMap(String prefix, Map<String, Object> result, Map<String, Object> content) 解析YAML- Parameters:
prefix- 前缀信息result- 数据结果content- 数据内容
-
replaceRefValue
替换本地变量占位符- Parameters:
properties- 属性信息value- 值信息- Returns:
- 替换后的信息
-
dump
将Bean对象或者Map写出到Writer- Parameters:
object- 对象writer-Writer
-
dump
public static void dump(Object object, Writer writer, org.yaml.snakeyaml.DumperOptions dumperOptions) 将Bean对象或者Map写出到Writer- Parameters:
object- 对象writer-WriterdumperOptions- 输出风格
-
sectionCreator
设置分区创建者功能- Parameters:
iniSectionCreator-Builder.IniSectionCreator- Returns:
- 当前类对象信息
-
commentCreator
设置评论创建者功能- Parameters:
iniCommentCreator-Builder.IniCommentCreator- Returns:
- 当前类对象信息
-
propertyCreator
设置属性创建器功能- Parameters:
iniPropertyCreator-Builder.IniPropertyCreator- Returns:
- 当前类对象信息
-
skipLine
跳过线,向行添加空值- Parameters:
length- 跳过线- Returns:
- 当前类对象信息
-
plus
Plus other builder- Parameters:
otherBuilder- other builder- Returns:
- 当前类对象信息
-
plus
Plus iniElement list- Parameters:
elements- IniElement list- Returns:
- 当前类对象信息
-
plusSection
Plus a section- Parameters:
value- section value- Returns:
- 当前类对象信息
-
plusSection
Plus a section with comment- Parameters:
value- section valuecomment- comment- Returns:
- 当前类对象信息
-
plusSection
Plus a section with comment- Parameters:
value- section valuecommentValue- comment value- Returns:
- 当前类对象信息
-
plusProperty
Plus a property- Parameters:
key- keyvalue- value- Returns:
- 当前类对象信息
-
plusProperty
Plus a property- Parameters:
key- keyvalue- valuecomment- 描述信息- Returns:
- 当前类对象信息
-
plusProperty
Plus a property- Parameters:
key- keyvalue- valuecommentValue- 描述信息- Returns:
- 当前类对象信息
-
plusProperties
Plus properties- Parameters:
properties- properties- Returns:
- 当前类对象信息
-
plusProperties
Plus properties- Parameters:
properties- propertiescomment- 描述信息- Returns:
- 当前类对象信息
-
plusProperties
Plus properties- Parameters:
properties- propertiescommentValue- 描述信息- Returns:
- 当前类对象信息
-
plusComment
-
build
-