LibreOffice Module jvmfwk (master) 1
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
jfw::NodeJava Class Reference

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_Boolm_enabled
 User configurable option. More...
 
std::optional< OUString > m_userClassPath
 User configurable option. More...
 
std::optional< CNodeJavaInfom_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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ Layer

Enumerator
USER 
SHARED 

Definition at line 116 of file elements.hxx.

Constructor & Destructor Documentation

◆ NodeJava()

jfw::NodeJava::NodeJava ( Layer  theLayer)
explicit

Definition at line 166 of file elements.cxx.

References jfw::getMode(), JFW_E_DIRECT_MODE, and jfw::JFW_MODE_DIRECT.

Member Function Documentation

◆ addJRELocation()

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().

◆ checkSettingsFileStatus()

jfw::FileStatus jfw::NodeJava::checkSettingsFileStatus ( OUString const &  sURL)
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().

◆ createSettingsDocument()

bool jfw::NodeJava::createSettingsDocument ( ) const
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().

◆ getEnabled()

const std::optional< sal_Bool > & jfw::NodeJava::getEnabled ( ) const
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().

◆ getJavaInfo()

const std::optional< CNodeJavaInfo > & jfw::NodeJava::getJavaInfo ( ) const
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().

◆ getJRELocations()

const std::optional<::std::vector< OUString > > & jfw::NodeJava::getJRELocations ( ) const
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().

◆ getSettingsPath()

OString jfw::NodeJava::getSettingsPath ( ) const
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().

◆ getSettingsURL()

OUString jfw::NodeJava::getSettingsURL ( ) const
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().

◆ getUserClassPath()

const std::optional< OUString > & jfw::NodeJava::getUserClassPath ( ) const
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().

◆ getVmParameters()

const std::optional<::std::vector< OUString > > & jfw::NodeJava::getVmParameters ( ) const
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().

◆ load()

void jfw::NodeJava::load ( )

◆ prepareSettingsDocument()

bool jfw::NodeJava::prepareSettingsDocument ( ) const
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).

Returns
JFW_E_CONFIG_READWRITE

Definition at line 351 of file elements.cxx.

References createSettingsDocument(), jfw::createSettingsStructure(), getSettingsPath(), and JFW_E_ERROR.

Referenced by load(), and write().

◆ setEnabled()

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().

◆ setJavaInfo()

void jfw::NodeJava::setJavaInfo ( const JavaInfo pInfo,
bool  bAutoSelect 
)

sets m_aInfo.

See setEnabled.

Parameters
bAutoSelecttrue- 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().

◆ setUserClassPath()

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().

◆ setVmParameters()

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().

◆ write()

void jfw::NodeJava::write ( ) const

Member Data Documentation

◆ m_enabled

std::optional<sal_Bool> jfw::NodeJava::m_enabled
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().

◆ m_javaInfo

std::optional<CNodeJavaInfo> jfw::NodeJava::m_javaInfo
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().

◆ m_JRELocations

std::optional<::std::vector<OUString> > jfw::NodeJava::m_JRELocations
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().

◆ m_layer

Layer jfw::NodeJava::m_layer
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().

◆ m_userClassPath

std::optional<OUString> jfw::NodeJava::m_userClassPath
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().

◆ m_vmParameters

std::optional<::std::vector<OUString> > jfw::NodeJava::m_vmParameters
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().


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