public interface ResourceApplication<CONFIG extends BaseConfiguration> extends Application<CONFIG>
Modifier and Type | Method and Description |
---|---|
default void |
before(CONFIG configuration)
default方法默认实现此方法, 请不要再实现此方法了。
流对象使用完毕时候会自动关流。
|
void |
before(Properties args,
CONFIG configuration)
此方法将会在配置文件装配完成后执行.
|
default Reader |
getReader()
获取Reader对象。
Properties在读取的时候,使用字节流无法读取中文,因此可以考虑使用getReader来进行转化。
|
default InputStream |
getStream()
获取配置文件的文件输入流对象,并根据此对象对配置对象进行自动装填。
获取到的流在使用完成后会自动关闭。
|
default void |
plus(Properties configProperties)
如果在配置进行注入的时候有什么额外的操作,重写此方法,否则不要重写。
|
String |
resourceName()
资源路径
|
after, author, getApplicationClass, getPackage
String resourceName()
default InputStream getStream()
default Reader getReader()
default void before(CONFIG configuration)
before
in interface Application<CONFIG extends BaseConfiguration>
configuration
- 配置类对象default void plus(Properties configProperties)
configProperties
- config 参数列表void before(Properties args, CONFIG configuration)
args
- properties配置内容configuration
- 配置好的配置文件Copyright © 2020. All rights reserved.