public class Readers extends Object
| Constructor and Description |
|---|
Readers() |
Readers(Factory formatterFactory) |
Readers(GroupMap groupMap)
构造
|
Readers(GroupMap groupMap,
Charset charset,
boolean isUseVariable)
构造
|
| Modifier and Type | Method and Description |
|---|---|
protected IniSetting |
defaultFormat(Reader reader)
format reader to ini bean
|
protected IniSetting |
defaultFormat(Reader reader,
int builderCapacity)
format reader to ini bean
|
Supplier<ElementFormatter<IniComment>> |
getCommentElementFormatterSupplier() |
protected Format |
getFormatter()
get a default formatter by factory
|
Supplier<ElementFormatter<IniProperty>> |
getPropertyElementFormatterSupplier() |
Supplier<ElementFormatter<IniSection>> |
getSectionElementFormatterSupplier() |
boolean |
load(InputStream inputStream)
加载设置文件 此方法不会关闭流对象
|
boolean |
load(org.aoju.bus.core.io.resource.Resource resource)
加载设置文件
|
IniSetting |
read(File file)
read ini file to bean
|
IniSetting |
read(InputStream in)
read ini data from an inputStream
|
IniSetting |
read(Path path)
read ini file to bean
|
IniSetting |
read(Reader reader)
to buffered and read
|
void |
setCommentElementFormatterSupplier(Supplier<ElementFormatter<IniComment>> commentElementFormatterSupplier) |
void |
setPropertyElementFormatterSupplier(Supplier<ElementFormatter<IniProperty>> propertyElementFormatterSupplier) |
void |
setSectionElementFormatterSupplier(Supplier<ElementFormatter<IniSection>> sectionElementFormatterSupplier) |
void |
setVarRegex(String regex)
设置变量的正则
正则只能有一个group表示变量本身,剩余为字符 例如 \$\{(name)\}表示${name}变量名为name的一个变量表示
|
void |
store(File file)
持久化当前设置,会覆盖掉之前的设置
持久化会不会保留之前的分组
|
void |
store(String absolutePath)
持久化当前设置,会覆盖掉之前的设置
持久化会不会保留之前的分组
|
public Readers()
public Readers(Factory formatterFactory)
public Readers(GroupMap groupMap)
groupMap - GroupedMappublic boolean load(org.aoju.bus.core.io.resource.Resource resource)
resource - 配置文件URLpublic boolean load(InputStream inputStream) throws IOException
inputStream - 文件流IOException - IO异常public void setVarRegex(String regex)
regex - 正则public void store(String absolutePath)
absolutePath - 设置文件的绝对路径public void store(File file)
file - 设置文件public IniSetting read(InputStream in) throws IOException
in - an ini data inputStreamIOException - io exceptionread(java.io.Reader)public IniSetting read(File file) throws IOException
file - ini fileIOException - io exceptionread(java.io.Reader)public IniSetting read(Path path) throws IOException
path - ini path(file)IOException - io exceptionread(java.io.Reader)public IniSetting read(Reader reader) throws IOException
reader - ini data readerIOException - io exceptionprotected IniSetting defaultFormat(Reader reader) throws IOException
reader - readerIniSetting beanIOException - io exceptiondefaultFormat(java.io.Reader, int)protected IniSetting defaultFormat(Reader reader, int builderCapacity) throws IOException
reader - readerbuilderCapacity - StringBuilder init paramIniSetting beanIOException - io exceptionpublic Supplier<ElementFormatter<IniComment>> getCommentElementFormatterSupplier()
public void setCommentElementFormatterSupplier(Supplier<ElementFormatter<IniComment>> commentElementFormatterSupplier)
public Supplier<ElementFormatter<IniSection>> getSectionElementFormatterSupplier()
public void setSectionElementFormatterSupplier(Supplier<ElementFormatter<IniSection>> sectionElementFormatterSupplier)
public Supplier<ElementFormatter<IniProperty>> getPropertyElementFormatterSupplier()
public void setPropertyElementFormatterSupplier(Supplier<ElementFormatter<IniProperty>> propertyElementFormatterSupplier)
Copyright © 2021. All rights reserved.