LibreOffice Module jvmfwk (master) 1
|
this class represents the java settings based on a particular settings file. More...
#include <elements.hxx>
Public Types | |
enum | Layer { USER , SHARED } |
Public Member Functions | |
NodeJava (Layer theLayer) | |
void | setEnabled (bool bEnabled) |
sets m_enabled. More... | |
void | setUserClassPath (const OUString &sClassPath) |
sets m_sUserClassPath. More... | |
void | setJavaInfo (const JavaInfo *pInfo, bool bAutoSelect) |
sets m_aInfo. More... | |
void | setVmParameters (std::vector< OUString > const &arParameters) |
sets the /java/vmParameters/param elements. More... | |
void | addJRELocation (OUString const &sLocation) |
adds a location to the already existing locations. More... | |
void | write () const |
writes the data to user settings. More... | |
void | load () |
load the values of the settings file. More... | |
const std::optional< sal_Bool > & | getEnabled () const |
returns the value of the element /java/enabled More... | |
const std::optional< OUString > & | getUserClassPath () const |
returns the value of the element /java/userClassPath. More... | |
const std::optional< CNodeJavaInfo > & | getJavaInfo () const |
returns the value of the element /java/javaInfo. More... | |
const std::optional<::std::vector< OUString > > & | getVmParameters () const |
returns the parameters from the element /java/vmParameters/param. More... | |
const std::optional<::std::vector< OUString > > & | getJRELocations () const |
returns the parameters from the element /java/jreLocations/location. More... | |
Private Member Functions | |
bool | prepareSettingsDocument () const |
creates settings file and fills it with default values. More... | |
bool | createSettingsDocument () const |
helper function for prepareSettingsDocument. More... | |
OString | getSettingsPath () const |
returns the system path to the data file which is to be used. More... | |
OUString | getSettingsURL () const |
returns the file URL to the data file which is to be used. More... | |
Static Private Member Functions | |
static jfw::FileStatus | checkSettingsFileStatus (OUString const &sURL) |
Verifies if the respective settings file exist. More... | |
Private Attributes | |
Layer | m_layer |
Determines the layer for which the instance the loads and writes the data. More... | |
std::optional< sal_Bool > | m_enabled |
User configurable option. More... | |
std::optional< OUString > | m_userClassPath |
User configurable option. More... | |
std::optional< CNodeJavaInfo > | m_javaInfo |
User configurable option. More... | |
std::optional<::std::vector< OUString > > | m_vmParameters |
User configurable option. More... | |
std::optional<::std::vector< OUString > > | m_JRELocations |
User configurable option. More... | |
this class represents the java settings based on a particular settings file.
Which settings file is used is determined by the value passed into the constructor and the values of the bootstrap parameters UNO_JAVA_JFW_USER_DATA and UNO_JAVA_JFW_SHARED_DATA.
The method load reads the data from the settings file. The method write stores the data into the settings file.
Definition at line 113 of file elements.hxx.
enum jfw::NodeJava::Layer |
Enumerator | |
---|---|
USER | |
SHARED |
Definition at line 116 of file elements.hxx.
|
explicit |
Definition at line 166 of file elements.cxx.
References jfw::getMode(), JFW_E_DIRECT_MODE, and jfw::JFW_MODE_DIRECT.
void jfw::NodeJava::addJRELocation | ( | OUString const & | sLocation | ) |
adds a location to the already existing locations.
Note: call load() before, then add the location and then call write().
Definition at line 575 of file elements.cxx.
References m_JRELocations.
Referenced by jfw_addJRELocation().
|
staticprivate |
Verifies if the respective settings file exist.
Definition at line 587 of file elements.cxx.
References jfw::FILE_DOES_NOT_EXIST, jfw::FILE_INVALID, and jfw::FILE_OK.
Referenced by createSettingsDocument().
|
private |
helper function for prepareSettingsDocument.
Definition at line 622 of file elements.cxx.
References checkSettingsFileStatus(), jfw::FILE_OK, jfw::getDirFromFile(), getSettingsPath(), getSettingsURL(), JFW_E_ERROR, NS_JAVA_FRAMEWORK, and NS_SCHEMA_INSTANCE.
Referenced by prepareSettingsDocument().
|
inline |
returns the value of the element /java/enabled
Definition at line 227 of file elements.hxx.
References m_enabled.
Referenced by jfw::MergedSettings::merge().
|
inline |
returns the value of the element /java/javaInfo.
Definition at line 234 of file elements.hxx.
References m_javaInfo.
Referenced by jfw::MergedSettings::merge().
|
inline |
returns the parameters from the element /java/jreLocations/location.
Definition at line 242 of file elements.hxx.
References m_JRELocations.
Referenced by jfw::MergedSettings::merge().
|
private |
returns the system path to the data file which is to be used.
The value depends on the member m_layer and the bootstrap parameters UNO_JAVA_JFW_USER_DATA and UNO_JAVA_JFW_SHARED_DATA.
Definition at line 325 of file elements.cxx.
References jfw::getSharedSettingsPath(), jfw::getUserSettingsPath(), m_layer, SHARED, and USER.
Referenced by createSettingsDocument(), load(), prepareSettingsDocument(), and write().
|
private |
returns the file URL to the data file which is to be used.
See getSettingsPath.
Definition at line 338 of file elements.cxx.
References jfw::BootParams::getSharedData(), jfw::BootParams::getUserData(), m_layer, SHARED, and USER.
Referenced by createSettingsDocument().
|
inline |
returns the value of the element /java/userClassPath.
Definition at line 230 of file elements.hxx.
References m_userClassPath.
Referenced by jfw::MergedSettings::merge().
|
inline |
returns the parameters from the element /java/vmParameters/param.
Definition at line 238 of file elements.hxx.
References m_vmParameters.
Referenced by jfw::MergedSettings::merge().
void jfw::NodeJava::load | ( | ) |
load the values of the settings file.
Definition at line 178 of file elements.cxx.
References jfw::checkFileURL(), jfw::FILE_DOES_NOT_EXIST, jfw::FILE_INVALID, getSettingsPath(), jfw::BootParams::getSharedData(), JFW_E_ERROR, m_enabled, m_javaInfo, m_JRELocations, m_layer, m_userClassPath, m_vmParameters, NS_SCHEMA_INSTANCE, prepareSettingsDocument(), SAL_INFO, SHARED, and USER.
Referenced by jfw_addJRELocation(), and jfw::MergedSettings::MergedSettings().
|
private |
creates settings file and fills it with default values.
When this function is called then it creates the settings file at the position determined by the bootstrap parameters (UNO_JAVA_JFW_USER_DATA, UNO_JAVA_JFW_SHARED_DATA) and m_layer, unless the file already exists (see createSettingsDocument).
Definition at line 351 of file elements.cxx.
References createSettingsDocument(), jfw::createSettingsStructure(), getSettingsPath(), and JFW_E_ERROR.
void jfw::NodeJava::setEnabled | ( | bool | bEnabled | ) |
sets m_enabled.
/java/enabled@xsi:nil will be set to false when write is called.
Definition at line 532 of file elements.cxx.
References m_enabled.
Referenced by jfw_setEnabled().
void jfw::NodeJava::setJavaInfo | ( | const JavaInfo * | pInfo, |
bool | bAutoSelect | ||
) |
sets m_aInfo.
See setEnabled.
bAutoSelect | true- called by jfw_setSelectedJRE false called by jfw_findAndSelectJRE |
Definition at line 543 of file elements.cxx.
References JavaInfo::arVendorData, m_javaInfo, JavaInfo::nRequirements, JavaInfo::sLocation, JavaInfo::sVendor, and JavaInfo::sVersion.
Referenced by jfw_findAndSelectJRE(), and jfw_setSelectedJRE().
void jfw::NodeJava::setUserClassPath | ( | const OUString & | sClassPath | ) |
sets m_sUserClassPath.
See setEnabled.
Definition at line 538 of file elements.cxx.
References m_userClassPath.
Referenced by jfw_setUserClassPath().
void jfw::NodeJava::setVmParameters | ( | std::vector< OUString > const & | arParameters | ) |
sets the /java/vmParameters/param elements.
When this method all previous values are removed and replaced by those in arParameters. /java/vmParameters@xsi:nil will be set to true when write() is called.
Definition at line 570 of file elements.cxx.
References m_vmParameters.
Referenced by jfw_setVMParameters().
void jfw::NodeJava::write | ( | ) | const |
writes the data to user settings.
Definition at line 376 of file elements.cxx.
References getSettingsPath(), JFW_E_ERROR, m_enabled, m_javaInfo, m_JRELocations, m_userClassPath, m_vmParameters, NS_JAVA_FRAMEWORK, NS_SCHEMA_INSTANCE, prepareSettingsDocument(), and SAL_INFO.
Referenced by jfw_addJRELocation(), jfw_findAndSelectJRE(), jfw_setEnabled(), jfw_setSelectedJRE(), jfw_setUserClassPath(), and jfw_setVMParameters().
|
private |
User configurable option.
/java/enabled If /java/enabled@xsi:nil == true then the value will be uninitialized after a call to load().
Definition at line 162 of file elements.hxx.
Referenced by getEnabled(), load(), setEnabled(), and write().
|
private |
User configurable option.
/java/javaInfo If /java/javaInfo@xsi:nil == true then the value is uninitialized after a call to load.
Definition at line 173 of file elements.hxx.
Referenced by getJavaInfo(), load(), setJavaInfo(), and write().
|
private |
User configurable option.
/java/jreLocations If /java/jreLocations@xsi:nil == true then the value is uninitialized after a call to load.
Definition at line 183 of file elements.hxx.
Referenced by addJRELocation(), getJRELocations(), load(), and write().
|
private |
Determines the layer for which the instance the loads and writes the data.
Definition at line 156 of file elements.hxx.
Referenced by getSettingsPath(), getSettingsURL(), and load().
|
private |
User configurable option.
/java/userClassPath If /java/userClassPath@xsi:nil == true then the value is uninitialized after a call to load().
Definition at line 168 of file elements.hxx.
Referenced by getUserClassPath(), load(), setUserClassPath(), and write().
|
private |
User configurable option.
/java/vmParameters If /java/vmParameters@xsi:nil == true then the value is uninitialized after a call to load.
Definition at line 178 of file elements.hxx.
Referenced by getVmParameters(), load(), setVmParameters(), and write().