Examples of XmlConfigStrategy


Examples of org.pdfsam.guiclient.configuration.services.xml.strategy.XmlConfigStrategy

      }
      configurationFilePath = configurationFile.getAbsolutePath();
      Document document = XmlUtility.parseXmlFile(configurationFile);
      if (document != null) {
        // setting up strategy
        XmlConfigStrategy strategy = null;
        Node node = document.selectSingleNode(VERSION_XPATH);
        if (node != null && "2".equals(node.getText().trim())) {
          strategy = new DefaultXmlStrategy(document);
        } else {
          strategy = new BackwardCompatibilityXmlStrategy(document);
        }

        initializeLocale(strategy);
        initializeLookAndFeel(strategy);
        initializeLoggingLevel(strategy);
        initializePoolSize(strategy);

        defaultWorkingDirectory = strategy.getDefaultWorkingDirectoryValue();
        defaultEnvironment = strategy.getDefaultEnvironmentValue();
        thumbnailsCreatorIdentifier = strategy.getThumbnailsCreatorIdentifierValue();
        checkForUpdates = isValidTrueValue(strategy.getCheckForUpdatesValue());
        playSounds = isValidTrueValue(strategy.getPlaySoundsValue());
        pluginAbsolutePath = strategy.getPluginAbsolutePath();
        askOverwriteConfirmation = isValidTrueValue(strategy.getAskOverwriteConfirmation());

        consoleServicesFacade = new ConsoleServicesFacade();
        strategy.close();
      } else {
        throw new ConfigurationException("Unable to parse xml configuration file.");
      }
    } catch (DocumentException e) {
      throw new ConfigurationException(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.