Example usage for org.apache.commons.collections ExtendedProperties isEmpty

List of usage examples for org.apache.commons.collections ExtendedProperties isEmpty

Introduction

In this page you can find the example usage for org.apache.commons.collections ExtendedProperties isEmpty.

Prototype

public synchronized boolean isEmpty() 

Source Link

Document

Tests if this hashtable maps no keys to values.

Usage

From source file:adalid.util.Utility.java

private static String[] getArguments(Class<?> clazz, ExtendedProperties properties, Level level) {
    if (properties == null) {
        logger.log(level, ARGS_FAILED + "; properties is null");
    } else if (properties.isEmpty()) {
        logger.log(level, ARGS_FAILED + "; properties is empty");
    } else {//from w ww.  j av a2  s  . c o m
        String key = clazz.getName() + ARGS_SUFFIX;
        try {
            String[] strings = properties.getStringArray(key);
            if (strings == null || strings.length == 0) {
                logger.log(level, ARGS_FAILED + "; property " + key + " not found");
            } else {
                return strings;
            }
        } catch (Exception e) {
            logger.log(level, ARGS_FAILED + "; " + key + " not properly defined (" + e + ")");
        }
    }
    return null;
}

From source file:adalid.commons.properties.PropertiesHandler.java

public static ExtendedProperties getExtendedProperties(String... filename) {
    if (filename == null || filename.length == 0) {
        return null;
    }/*  www  .j a v a 2s  .c  o m*/
    int last = filename.length - 1;
    ExtendedProperties properties = null;
    for (int i = 0; i < filename.length && (properties == null || properties.isEmpty()); i++) {
        properties = getExtendedProperties(filename[i], i == last ? Level.ERROR : Level.INFO, Level.INFO);
    }
    return properties;
}

From source file:adalid.commons.properties.PropertiesHandler.java

private static ExtendedProperties getBootstrappingProperties() {
    ExtendedProperties properties = getExtendedProperties(BOOTSTRAPPING_FILE_PATH, Level.INFO);
    return properties == null || properties.isEmpty()
            ? getResourceAsExtendedProperties("/" + BOOTSTRAPPING_FILE_NAME)
            : properties;/*from w  ww . ja  v a2  s  .  com*/
}