Package java.util

Examples of java.util.Properties$Parser


        DataSourceInfo dataSourceInfo = null;

        if (canMap(resource)) {
            OracleDataSource source = (OracleDataSource) resource;
            OracleConnectionCacheManager occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
            Properties cacheProperties = source.getConnectionCacheProperties();
            String cacheName = source.getConnectionCacheName();
            cacheName = cacheName != null && occm.existsCache(cacheName) ? cacheName : null;

            if (cacheProperties != null) {

                dataSourceInfo = new DataSourceInfo();
                if (cacheName != null) {
                    dataSourceInfo.setBusyConnections(occm.getNumberOfActiveConnections(cacheName));
                    dataSourceInfo.setEstablishedConnections(occm.getNumberOfAvailableConnections(cacheName) + dataSourceInfo.getBusyConnections());
                } else {
                    dataSourceInfo.setBusyConnections(0);
                    dataSourceInfo.setEstablishedConnections(0);
                }

                dataSourceInfo.setMaxConnections(Utils.toInt(cacheProperties.getProperty("MaxLimit"), -1));
                dataSourceInfo.setJdbcURL(source.getURL());
                dataSourceInfo.setUsername(source.getUser());
                dataSourceInfo.setResettable(true);
            }
        }
View Full Code Here


  }

  private void loadSettings() {

    try {
      Properties prop = mConfigurationHandler.loadSettings();
      loadSettings(prop);
    } catch (IOException e) {
      ErrorHandler.handle("Could not load reminder data.", e);
    }
View Full Code Here

    }
  }

  private void loadSettings(Properties settings) {
    if (settings == null) {
      settings = new Properties();
    }
    if (settings.getProperty("usemsgbox") == null) {
      settings.setProperty("usemsgbox", "true");
    }
    mSettings = settings;
View Full Code Here

     * @param props The properties to search.
     * @return the enumeration of all of the property names of the primary source;
     * the enumeration may be empty if there is an error connecting to the property sources.
     */
    public static Properties getProperties(String filterPattern, Properties props)  {
        Properties results = new Properties();

        boolean addAll = false;
        String searchStr = null;
        int globIndex = filterPattern.indexOf('*');
        if ( globIndex == -1 ) {
            searchStr = filterPattern;
        } else if ( globIndex == 0 ) {
            addAll = true;
        } else {
            searchStr = filterPattern.substring(0, globIndex);
        }

        Enumeration propNameEnum = props.propertyNames();
        while ( propNameEnum.hasMoreElements() ) {
            String name = (String) propNameEnum.nextElement();
            if ( name.startsWith(searchStr)) {
              Object value = props.get(name);
              if (value != null) {
                results.put(name.substring(searchStr.length()), value);
              }
            }
            else if (addAll) {
              results.put(name, props.get(name));
            }
        }

        return results;
    }
View Full Code Here

     * <code>UnmodifiableProperties</code>, this method returns an
     * <code>UnmodifiableProperties</code> instance around a new (flattened)
     * copy of the underlying Properties object.
     */
    public static Properties clone( Properties props, Properties defaults, boolean deepClone ) {
        Properties result = null;
        if ( defaults != null ) {
            if ( deepClone ) {
                defaults = clone(defaults);
            }
            result = new Properties(defaults);
        } else {
            result = new Properties();
        }
       
        putAll(result, props);
       
        return result;
View Full Code Here

    }
   
    public static Properties load(String fileName) throws IOException {
        InputStream is = null;
        try {
            Properties props = new Properties();
            is = new FileInputStream(fileName);
            props.load(is);
            return props;
        } finally {
            if (is != null) {
                is.close();
            }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
        QueryObjectModelFactoryImpl factory = new QOMF(resolver);
        ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
        parser = new Parser(factory, vf);
    }
View Full Code Here

        super.setUp();
        WorkspaceImpl wsp = (WorkspaceImpl) superuser.getWorkspace();
        QueryManagerImpl qm = (QueryManagerImpl) wsp.getQueryManager();
        QueryObjectModelFactoryImpl factory = (QueryObjectModelFactoryImpl) qm
                .getQOMFactory();
        parser = new Parser(factory, superuser.getValueFactory());
    }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

TOP

Related Classes of java.util.Properties$Parser

Copyright © 2018 www.massapicom. 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.