public abstract class JFinalConfig extends Object
Config order: configConstant(), configPlugin(), configRoute(), configEngine(), configInterceptor(), configHandler()
Constructor and Description |
---|
JFinalConfig() |
Modifier and Type | Method and Description |
---|---|
void |
afterJFinalStart()
Call back after JFinal start
|
void |
beforeJFinalStop()
Call back before JFinal stop
|
abstract void |
configConstant(Constants me)
Config constant
|
abstract void |
configEngine(Engine me)
Config engine
|
abstract void |
configHandler(Handlers me)
Config handler
|
abstract void |
configInterceptor(Interceptors me)
Config interceptor applied to all actions.
|
abstract void |
configPlugin(Plugins me)
Config plugin
|
abstract void |
configRoute(Routes me)
Config route
|
String |
getProperty(String key) |
String |
getProperty(String key,
String defaultValue) |
Boolean |
getPropertyToBoolean(String key) |
Boolean |
getPropertyToBoolean(String key,
Boolean defaultValue) |
Integer |
getPropertyToInt(String key) |
Integer |
getPropertyToInt(String key,
Integer defaultValue) |
Long |
getPropertyToLong(String key) |
Long |
getPropertyToLong(String key,
Long defaultValue) |
Properties |
loadPropertyFile(File file)
Load property file.
|
Properties |
loadPropertyFile(File file,
String encoding)
Load property file
Example:
loadPropertyFile(new File("/var/config/my_config.txt"), "UTF-8"); |
Properties |
loadPropertyFile(String fileName)
Load property file.
|
Properties |
loadPropertyFile(String fileName,
String encoding)
Load property file.
|
void |
unloadPropertyFile() |
protected Prop prop
public abstract void configConstant(Constants me)
public abstract void configRoute(Routes me)
public abstract void configEngine(Engine me)
public abstract void configPlugin(Plugins me)
public abstract void configInterceptor(Interceptors me)
public abstract void configHandler(Handlers me)
public void afterJFinalStart()
public void beforeJFinalStop()
public Properties loadPropertyFile(String fileName)
loadPropertyFile(String, String)
public Properties loadPropertyFile(String fileName, String encoding)
fileName
- the file in CLASSPATH or the sub directory of the CLASSPATHencoding
- the encodingpublic Properties loadPropertyFile(File file)
loadPropertyFile(File, String)
public Properties loadPropertyFile(File file, String encoding)
file
- the properties File objectencoding
- the encodingpublic void unloadPropertyFile()
Copyright © 2018. All rights reserved.