Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.XMLConfiguration.containsKey()


            mp.setInputFile(cmd.getOptionValue("if"), Charset.forName((String) config.getProperty( "config.input-file-encoding" )));
            mp.setOutputFile(cmd.getOptionValue("of"), Charset.forName((String) config.getProperty( "config.output-file-encoding" )));

            // Set additional options
            if( config.containsKey("config.input-id-prefix") ) mp.setInputIDPrefix((String) config.getProperty("config.input-id-prefix"));
            if( config.containsKey("config.count-threshold") ) mp.setCountThreshold(Integer.valueOf((String) config.getProperty("config.count-threshold")) );

            if( cmd.hasOption( "v" ) ) System.out.println("Converting Mappings-Hash & Preparing Processors");

            try {
View Full Code Here


            mp.setInputFile(cmd.getOptionValue("if"), Charset.forName((String) config.getProperty( "config.input-file-encoding" )));
            mp.setOutputFile(cmd.getOptionValue("of"), Charset.forName((String) config.getProperty( "config.output-file-encoding" )));

            // Set additional options
            if( config.containsKey("config.input-id-prefix") ) mp.setInputIDPrefix((String) config.getProperty("config.input-id-prefix"));
            if( config.containsKey("config.count-threshold") ) mp.setCountThreshold(Integer.valueOf((String) config.getProperty("config.count-threshold")) );

            if( cmd.hasOption( "v" ) ) System.out.println("Converting Mappings-Hash & Preparing Processors");

            try {
                mp.prepare();
View Full Code Here

            e.printStackTrace();
            System.exit(2);
        }

        // Set input and output order (if provided by the config file)
        if( config.containsKey( "config.input-field-order" ) ) MappingsHandler.Self().setInputOrder( (ArrayList<String>) config.getProperty( "config.input-field-order") );;
        if( config.containsKey( "config.output-field-order" ) ) MappingsHandler.Self().setOutputOrder( (ArrayList<String>) config.getProperty( "config.output-field-order") );;

        //
        // START PROCESSING HERE
        //
View Full Code Here

            System.exit(2);
        }

        // Set input and output order (if provided by the config file)
        if( config.containsKey( "config.input-field-order" ) ) MappingsHandler.Self().setInputOrder( (ArrayList<String>) config.getProperty( "config.input-field-order") );;
        if( config.containsKey( "config.output-field-order" ) ) MappingsHandler.Self().setOutputOrder( (ArrayList<String>) config.getProperty( "config.output-field-order") );;

        //
        // START PROCESSING HERE
        //
        MappingProcess mp = new MappingProcess();
View Full Code Here

    compositeConfig.addConfiguration(propConfig);
   
   
    Properties properties = new Properties();
    if ("Hibernate".equals(propConfig.getString(Property.PERSISTENCE_PROVIDER))) {
      if (propConfig.containsKey(Property.DATASOURCE))
        properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
      if (propConfig.containsKey(Property.HBM_DDL_AUTO))
        properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
      if (propConfig.containsKey(Property.DEFAULT_SCHEMA))
        properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
View Full Code Here

   
    Properties properties = new Properties();
    if ("Hibernate".equals(propConfig.getString(Property.PERSISTENCE_PROVIDER))) {
      if (propConfig.containsKey(Property.DATASOURCE))
        properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
      if (propConfig.containsKey(Property.HBM_DDL_AUTO))
        properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
      if (propConfig.containsKey(Property.DEFAULT_SCHEMA))
        properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
      if (propConfig.containsKey(Property.HIBERNATE_DIALECT))
        properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
View Full Code Here

    if ("Hibernate".equals(propConfig.getString(Property.PERSISTENCE_PROVIDER))) {
      if (propConfig.containsKey(Property.DATASOURCE))
        properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
      if (propConfig.containsKey(Property.HBM_DDL_AUTO))
        properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
      if (propConfig.containsKey(Property.DEFAULT_SCHEMA))
        properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
      if (propConfig.containsKey(Property.HIBERNATE_DIALECT))
        properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
    }
    // initialize the entityManagerFactory.
View Full Code Here

        properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
      if (propConfig.containsKey(Property.HBM_DDL_AUTO))
        properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
      if (propConfig.containsKey(Property.DEFAULT_SCHEMA))
        properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
      if (propConfig.containsKey(Property.HIBERNATE_DIALECT))
        properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
    }
    // initialize the entityManagerFactory.
    PersistenceManager.initializeEntityManagerFactory(propConfig.getString(Property.JUDDI_PERSISTENCEUNIT_NAME), properties);
    // Properties from the persistence layer
View Full Code Here

        ttypes.add(TransactionType.INVALID);
        for (int i = 0; i < numTxnTypes; i++) {
            String key = "transactiontypes.transactiontype(" + i + ")";
            String txnName = xmlConfig.getString(key + ".name");
            int txnId = i + 1;
            if (xmlConfig.containsKey(key + ".id")) {
                txnId = xmlConfig.getInt(key + ".id");
            }
            ttypes.add(bench.initTransactionType(txnName, txnId));
        } // FOR
        TransactionTypes tt = new TransactionTypes(ttypes);
View Full Code Here

  @SuppressWarnings("unchecked")
    public WikipediaBenchmark(WorkloadConfiguration workConf) {   
    super("wikipedia", workConf, true);
   
    XMLConfiguration xml = workConf.getXmlConfig();
    this.traceInput = (xml != null && xml.containsKey("tracefile") ? new File(xml.getString("tracefile")) : null);
    if (xml != null && xml.containsKey("traceOut")) {
        this.traceSize = xml.getInt("traceOut");
        this.traceOutput = new File(xml.getString("tracefile"));
    } else {
        this.traceSize = 0;
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.