Java Properties Get getLocalizedProperties(String[] propertyKeys, Properties properties)

Here you can find the source of getLocalizedProperties(String[] propertyKeys, Properties properties)

Description

get Localized Properties

License

Open Source License

Declaration

static public Properties getLocalizedProperties(String[] propertyKeys, Properties properties) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from w w w  . ja v  a  2s . c om
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.util.*;

public class Main {
    static public Properties getLocalizedProperties(String[] propertyKeys, Properties properties) {
        Properties localizedProperties = new Properties();
        for (int i = 0; i < propertyKeys.length; i++) {
            String key = propertyKeys[i];
            if (key != null) {
                String localizedValue = properties.getProperty(key);
                if (localizedValue != null)
                    localizedProperties.put(key, localizedValue);
            }
        }
        return localizedProperties;
    }
}

Related

  1. getInt(Properties props, String name, int defaultValue)
  2. getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo)
  3. getIntInRange(Properties props, String name, int defaultValue, int min, int max)
  4. getIntProperty(Properties props, String keyword, int defaultValue)
  5. getIsB37PropertyValue(final Properties dataSourceProperties)
  6. getLong(Properties props, String string, long defaultV)
  7. getNestedProperties(String prefix, Properties properties)
  8. getProp(Properties props, String name)
  9. getPropertiesForBloomFilter( int requiredFieldsSize, int matchKeySize)