ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Public Methods | Protected Fields | Protected Methods | List of all members
ConfigurationPlugin Class Referenceabstract
Inheritance diagram for ConfigurationPlugin:
[legend]
Collaboration diagram for ConfigurationPlugin:
[legend]

Class Description


Abstract class that represents a plug in for class Configuration to provide configuration data from specific configuration data source.

See documentation of namespace com.aworx.lib.config for more information on ALib external configuration variables.

The plug-in also may have the ability to write data. The default implementation for writing configuration data returns constant false, indicating that this plug-in never writes anything (e.g. command line parameter plug-in, environment variable plug-in).

Category and Variable names are character case insensitive for the plug-ins predefined with ALib. It is recommended to to ignore character case in custom specializations of this class as well.

Public Fields

XTernalizer stringConverter
 

Public Methods

boolean load (Variable variable)
 
abstract boolean load (Variable variable, boolean searchOnly)
 
boolean store (Variable variable)
 
boolean store (Variable variable, Object externalizedValue)
 

Protected Fields

XTernalizer defaultStringConverter = new XTernalizer()
 

Protected Methods

 ConfigurationPlugin ()
 

Constructor & Destructor Documentation

◆ ConfigurationPlugin()

ConfigurationPlugin ( )
protected

Constructor which is protected, as this is an abstract class.

Member Function Documentation

◆ load() [1/2]

boolean load ( Variable  variable)

Overloaded method providing default value false for parameter searchOnly.

Parameters
variableThe variable to retrieve.
Returns
true if variable was found within this configuration source, false if not.

◆ load() [2/2]

abstract boolean load ( Variable  variable,
boolean  searchOnly 
)
abstract

Abstract method that has to be overwritten by descendants. Searches and by default retrieves the value of a configuration variable. If searchOnly is true, then the variable value is not read.

Parameters
variableThe variable to retrieve.
searchOnlyIf true, the variable must not be set. Defaults to false.
Returns
true if variable was found within this configuration source, false if not.

Reimplemented in InMemoryPlugin, CLIArgs, and Environment.

◆ store() [1/2]

boolean store ( Variable  variable)

Writes a variable to the configuration. This default implementation just returns false. If this method is not overwritten in descendants, those descendants are not designed to write data.

Parameters
variableThe variable to store.
Returns
true if the variable was written, false if not which typically indicates that this plug-in is not able to write values.

Reimplemented in IniFile, and InMemoryPlugin.

◆ store() [2/2]

boolean store ( Variable  variable,
Object  externalizedValue 
)

Convenience method that parses the values from the given string using field stringConverter and then invokes store.

Parameters
variableThe variable to store.
externalizedValueThe value to parse into the variable before storing
Returns
true if the variable was written, false if not which typically indicates that this plug-in is not able to write values.

Member Data Documentation

◆ defaultStringConverter

XTernalizer defaultStringConverter = new XTernalizer()
protected

The default external string converter

◆ stringConverter

XTernalizer stringConverter

The external string converter. By default this points to field defaultStringConverter.


The documentation for this class was generated from the following file: