Package org.apache.kerby.config
Class Conf
java.lang.Object
org.apache.kerby.config.Conf
- All Implemented Interfaces:
Config
A general class to describe and store all the config files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIniConfig(File iniFile) voidaddJsonConfig(File jsonFile) voidaddMapConfig(Map<String, Object> mapConfig) voidaddPropertiesConfig(File propertiesFile) voidaddPropertiesConfig(Properties propertiesConfig) voidaddResource(Resource resource) Load the resource name and content in one step.voidaddXmlConfig(File xmlFile) getBoolean(String name) getBoolean(String name, Boolean defaultValue) getBoolean(ConfigKey name, boolean useDefault) Class<?>Class<?>Class<?><T> TgetInstance(String name) <T> TgetInstance(String name, Class<T> xface) <T> TgetInstance(ConfigKey name) getNames()getTrimmed(String name) getTrimmed(ConfigKey name) voidreload()For users usage, to determine whether to reload config files.voidsetBoolean(String name, Boolean value) Set a boolean value for the specified propertyvoidsetBoolean(ConfigKey name, Boolean value) Set a boolean value for the specified propertyvoidSet a float value for the specified propertyvoidSet a float value for the specified propertyvoidSet an int value for the specified propertyvoidSet an int value for the specified propertyvoidSet a long value for the specified propertyvoidSet a long value for the specified propertyvoidValues user sets will be add in config directly.voidSet a string value for the specified property
-
Constructor Details
-
Conf
public Conf()
-
-
Method Details
-
addXmlConfig
- Throws:
IOException
-
addIniConfig
- Throws:
IOException
-
addJsonConfig
- Throws:
IOException
-
addPropertiesConfig
- Throws:
IOException
-
addPropertiesConfig
-
addMapConfig
-
addResource
Load the resource name and content in one step. Add synchronized to avoid conflicts- Parameters:
resource- the config resource
-
reload
public void reload()For users usage, to determine whether to reload config files. Add synchronized to avoid conflicts -
getResource
- Specified by:
getResourcein interfaceConfig
-
getNames
-
getString
-
getString
-
getString
-
setString
Values user sets will be add in config directly. Add synchronized to avoid conflicts -
setString
Description copied from interface:ConfigSet a string value for the specified property -
getTrimmed
- Specified by:
getTrimmedin interfaceConfig
-
getTrimmed
- Specified by:
getTrimmedin interfaceConfig
-
getBoolean
- Specified by:
getBooleanin interfaceConfig
-
getBoolean
- Specified by:
getBooleanin interfaceConfig
-
getBoolean
- Specified by:
getBooleanin interfaceConfig
-
setBoolean
Description copied from interface:ConfigSet a boolean value for the specified property- Specified by:
setBooleanin interfaceConfig- Parameters:
name- The property namevalue- The boolean value
-
setBoolean
Description copied from interface:ConfigSet a boolean value for the specified property- Specified by:
setBooleanin interfaceConfig- Parameters:
name- The config key namevalue- The boolean value
-
getInt
-
getInt
-
getInt
-
setInt
Description copied from interface:ConfigSet an int value for the specified property -
setInt
Description copied from interface:ConfigSet an int value for the specified property -
getLong
-
getLong
-
getLong
-
setLong
Description copied from interface:ConfigSet a long value for the specified property -
setLong
Description copied from interface:ConfigSet a long value for the specified property -
getFloat
-
getFloat
-
getFloat
-
setFloat
Description copied from interface:ConfigSet a float value for the specified property -
setFloat
Description copied from interface:ConfigSet a float value for the specified property -
getList
-
getList
-
getList
-
getConfig
-
getConfig
-
getClass
- Specified by:
getClassin interfaceConfig- Throws:
ClassNotFoundException
-
getClass
- Specified by:
getClassin interfaceConfig- Throws:
ClassNotFoundException
-
getClass
- Specified by:
getClassin interfaceConfig- Throws:
ClassNotFoundException
-
getInstance
- Specified by:
getInstancein interfaceConfig- Throws:
ClassNotFoundException
-
getInstance
- Specified by:
getInstancein interfaceConfig- Throws:
ClassNotFoundException
-
getInstance
- Specified by:
getInstancein interfaceConfig- Throws:
ClassNotFoundException
-