public final class WebConfigParamUtils extends Object
Constructor and Description |
---|
WebConfigParamUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBooleanInitParameter(ExternalContext context,
String name)
Gets the boolean init parameter value from the specified context.
|
static boolean |
getBooleanInitParameter(ExternalContext context,
String[] names)
Gets the boolean init parameter value from the specified context.
|
static boolean |
getBooleanInitParameter(ExternalContext context,
String[] names,
boolean defaultValue)
Gets the boolean init parameter value from the specified context.
|
static boolean |
getBooleanInitParameter(ExternalContext context,
String[] names,
boolean defaultValue,
String[] valuesIgnoreCase,
boolean returnOnValueEqualsIgnoreCase)
Gets the boolean init parameter value from the specified context.
|
static boolean |
getBooleanInitParameter(ExternalContext context,
String name,
boolean defaultValue)
Gets the boolean init parameter value from the specified context.
|
static boolean |
getBooleanInitParameter(ExternalContext context,
String name,
boolean defaultValue,
String[] valuesIgnoreCase,
boolean returnOnValueEqualsIgnoreCase)
Gets the boolean init parameter value from the specified context.
|
static <T> T |
getInstanceInitParameter(ExternalContext context,
String name,
String deprecatedName,
T defaultValue)
Gets the init parameter value from the specified context and instanciate it.
|
static int |
getIntegerInitParameter(ExternalContext context,
String name)
Gets the int init parameter value from the specified context.
|
static int |
getIntegerInitParameter(ExternalContext context,
String[] names)
Gets the int init parameter value from the specified context.
|
static int |
getIntegerInitParameter(ExternalContext context,
String[] names,
int defaultValue)
Gets the int init parameter value from the specified context.
|
static int |
getIntegerInitParameter(ExternalContext context,
String name,
int defaultValue)
Gets the int init parameter value from the specified context.
|
static long |
getLongInitParameter(ExternalContext context,
String name)
Gets the long init parameter value from the specified context.
|
static long |
getLongInitParameter(ExternalContext context,
String[] names)
Gets the long init parameter value from the specified context.
|
static long |
getLongInitParameter(ExternalContext context,
String[] names,
long defaultValue)
Gets the long init parameter value from the specified context.
|
static long |
getLongInitParameter(ExternalContext context,
String name,
long defaultValue)
Gets the long init parameter value from the specified context.
|
static String |
getStringInitParameter(ExternalContext context,
String name)
Gets the String init parameter value from the specified context.
|
static String |
getStringInitParameter(ExternalContext context,
String[] names)
Gets the String init parameter value from the specified context.
|
static String |
getStringInitParameter(ExternalContext context,
String[] names,
String defaultValue)
Gets the String init parameter value from the specified context.
|
static String |
getStringInitParameter(ExternalContext context,
String name,
String defaultValue)
Gets the String init parameter value from the specified context.
|
public static String getStringInitParameter(ExternalContext context, String name)
null
context
- the application's external contextname
- the init parameter's namenull
otherwiseNullPointerException
- if context or name is null
public static String getStringInitParameter(ExternalContext context, String name, String defaultValue)
null
context
- the application's external contextname
- the init parameter's namedefaultValue
- the value by default if null or emptynull
otherwiseNullPointerException
- if context or name is null
public static String getStringInitParameter(ExternalContext context, String[] names)
null
context
- the application's external contextnames
- the init parameter's names, the first one is scanned first. Usually used when a
param has multiple aliasesnull
otherwiseNullPointerException
- if context or name is null
public static String getStringInitParameter(ExternalContext context, String[] names, String defaultValue)
null
context
- the application's external contextnames
- the init parameter's names, the first one is scanned first. Usually used when a param has
multiple aliasesdefaultValue
- the value by default if null or emptynull
otherwiseNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String name)
context
- the application's external contextname
- the init parameter's nameNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String name, boolean defaultValue)
context
- the application's external contextname
- the init parameter's namedefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String name, boolean defaultValue, String[] valuesIgnoreCase, boolean returnOnValueEqualsIgnoreCase)
context
- the application's external contextname
- the init parameter's namedefaultValue
- the default value to return in case the parameter was not setvaluesIgnoreCase
- an array of valid values to matchreturnOnValueEqualsIgnoreCase
- the value to return in case the parameter match with valuesIgnoreCaseNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String[] names)
context
- the application's external contextnames
- the init parameter's namesNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String[] names, boolean defaultValue)
context
- the application's external contextnames
- the init parameter's namesdefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static boolean getBooleanInitParameter(ExternalContext context, String[] names, boolean defaultValue, String[] valuesIgnoreCase, boolean returnOnValueEqualsIgnoreCase)
context
- the application's external contextnames
- the init parameter's namesdefaultValue
- the default value to return in case the parameter was not setvaluesIgnoreCase
- an array of valid values to matchreturnOnValueEqualsIgnoreCase
- the value to return in case the parameter match with valuesIgnoreCaseNullPointerException
- if context or name is null
public static int getIntegerInitParameter(ExternalContext context, String name)
context
- the application's external contextname
- the init parameter's nameNullPointerException
- if context or name is null
public static int getIntegerInitParameter(ExternalContext context, String name, int defaultValue)
context
- the application's external contextname
- the init parameter's namedefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static int getIntegerInitParameter(ExternalContext context, String[] names)
context
- the application's external contextnames
- the init parameter's namesNullPointerException
- if context or name is null
public static int getIntegerInitParameter(ExternalContext context, String[] names, int defaultValue)
context
- the application's external contextnames
- the init parameter's namesdefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static long getLongInitParameter(ExternalContext context, String name)
context
- the application's external contextname
- the init parameter's nameNullPointerException
- if context or name is null
public static long getLongInitParameter(ExternalContext context, String name, long defaultValue)
context
- the application's external contextname
- the init parameter's namedefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static long getLongInitParameter(ExternalContext context, String[] names)
context
- the application's external contextnames
- the init parameter's namesNullPointerException
- if context or name is null
public static long getLongInitParameter(ExternalContext context, String[] names, long defaultValue)
context
- the application's external contextnames
- the init parameter's namesdefaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
public static <T> T getInstanceInitParameter(ExternalContext context, String name, String deprecatedName, T defaultValue)
context
- the application's external contextname
- the init parameter's namedeprecatedName
- the init parameter's deprecated name.defaultValue
- the default value to return in case the parameter was not setNullPointerException
- if context or name is null
Copyright © 2021 The Apache Software Foundation. All rights reserved.