本文整理汇总了Java中org.apache.commons.collections.ExtendedProperties.getStringArray方法的典型用法代码示例。如果您正苦于以下问题:Java ExtendedProperties.getStringArray方法的具体用法?Java ExtendedProperties.getStringArray怎么用?Java ExtendedProperties.getStringArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections.ExtendedProperties
的用法示例。
在下文中一共展示了ExtendedProperties.getStringArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deletePreviouslyGeneratedFiles
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void deletePreviouslyGeneratedFiles(ExtendedProperties properties) {
String[] stringArray;
Set<String> stringPropertyNames = properties.keySet();
for (String name : stringPropertyNames) {
switch (name) {
case DO_CASCADED_DELETE:
stringArray = properties.getStringArray(name);
deletePreviouslyGeneratedFiles(name, stringArray, true);
break;
case DO_ISOLATED_DELETE:
stringArray = properties.getStringArray(name);
deletePreviouslyGeneratedFiles(name, stringArray, false);
break;
}
}
}
示例2: getArguments
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
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 {
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;
}
示例3: init
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
@Override
public void init(ExtendedProperties configuration) {
String[] all = configuration.getStringArray(IncludeKey);
include = new HashSet<String>();
match = new HashSet<String>();
if (all != null) {
for (String s : all) {
if (s.endsWith("/*")) {
match.add(s.substring(0, s.length() - 1));
} else {
include.add(s);
}
}
}
if (log.isTraceEnabled()) {
log.trace("FixedClasspathResourceLoader : initialization complete with include:"
+ include);
}
}
示例4: init
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
/**
* This is abstract in the base class, so we need it.
* <br>
* NOTE: this expects that the ServletContext has already
* been placed in the runtime's application attributes
* under its full class name (i.e. "javax.servlet.ServletContext").
*
* @param configuration the {@link ExtendedProperties} associated with
* this resource loader.
*/
public void init(ExtendedProperties configuration)
{
paths = configuration.getStringArray("path");
if (paths == null || paths.length == 0)
{
paths = new String[1];
paths[0] = "/";
}
else
{
/* make sure the paths end with a '/' */
for (int i = 0; i < paths.length; i++)
{
if (!paths[i].endsWith("/"))
{
paths[i] += '/';
}
}
}
//My_System.variable("paths", paths);
}
示例5: printExtendedProperties
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
public static void printExtendedProperties(ExtendedProperties extendedProperties) {
ArrayList<String> list = new ArrayList<>();
for (Iterator i = extendedProperties.getKeys(); i.hasNext();) {
list.add((String) i.next());
}
String[] names = new String[list.size()];
list.toArray(names);
Arrays.sort(names);
String[] values;
for (String name : names) {
values = extendedProperties.getStringArray(name);
logger.trace(name + " = " + (StringUtils.containsIgnoreCase(name, "password") ? "***" : getArrayString(values)));
}
}
示例6: createDirectories
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void createDirectories(ExtendedProperties properties) {
String[] stringArray;
Set<String> stringPropertyNames = properties.keySet();
for (String name : stringPropertyNames) {
switch (name) {
case DO_CREATE_DIR:
stringArray = properties.getStringArray(name);
createDirectories(name, stringArray);
break;
}
}
}
示例7: getComparator
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") // unchecked cast
private Comparator<?> getComparator(ExtendedProperties properties, String keyPreffix) {
String key = keyPreffix + ".comparator";
String[] classNames = properties.getStringArray(key);
List<Comparator<?>> comparators = new ArrayList<>();
Comparator<?> c;
for (String name : classNames) {
c = getComparator(name);
if (c != null) {
comparators.add(c);
}
}
return comparators.isEmpty() ? null : (Comparator<?>) ComparatorUtils.chainedComparator(comparators); // unchecked cast
}
示例8: init
import org.apache.commons.collections.ExtendedProperties; //导入方法依赖的package包/类
/**
* This is abstract in the base class, so we need it.
* <br>
* NOTE: this expects that the ServletContext has already
* been placed in the runtime's application attributes
* under its full class name (i.e. "javax.servlet.ServletContext").
*
* @param configuration the {@link ExtendedProperties} associated with
* this resource loader.
*/
public void init(ExtendedProperties configuration)
{
log.trace("WebappResourceLoader: initialization starting.");
/* get configured paths */
paths = configuration.getStringArray("path");
if (paths == null || paths.length == 0)
{
paths = new String[1];
paths[0] = "/";
}
else
{
/* make sure the paths end with a '/' */
for (int i=0; i < paths.length; i++)
{
if (!paths[i].endsWith("/"))
{
paths[i] += '/';
}
log.info("WebappResourceLoader: added template path - '" + paths[i] + "'");
}
}
/* get the ServletContext */
Object obj = rsvc.getApplicationAttribute(ServletContext.class.getName());
if (obj instanceof ServletContext)
{
servletContext = (ServletContext)obj;
}
else
{
log.error("WebappResourceLoader: unable to retrieve ServletContext");
}
/* init the template paths map */
templatePaths = new HashMap();
log.trace("WebappResourceLoader: initialization complete.");
}