Class SystemProperties
java.lang.Object
org.codehaus.commons.compiler.util.SystemProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getBooleanClassProperty
(Class<?> targetClass, String classPropertyName) static boolean
getBooleanClassProperty
(Class<?> targetClass, String classPropertyName, boolean defaultValue) static String
getClassProperty
(Class<?> targetClass, String classPropertyName) static String
getClassProperty
(Class<?> targetClass, String classPropertyName, String defaultValue) Gets the value of a "class property".static int
getIntegerClassProperty
(Class<?> targetClass, String classPropertyName, int defaultValue)
-
Constructor Details
-
SystemProperties
private SystemProperties()
-
-
Method Details
-
getBooleanClassProperty
- Returns:
- Whether the class property is set and its value equals, ignoring case,
"true"
- See Also:
-
getBooleanClassProperty
public static boolean getBooleanClassProperty(Class<?> targetClass, String classPropertyName, boolean defaultValue) - Returns:
- Whether the value of the class property its value equals, ignoring case,
"true"
, or, if that class property is not set, defaultValue - See Also:
-
getIntegerClassProperty
public static int getIntegerClassProperty(Class<?> targetClass, String classPropertyName, int defaultValue) - Returns:
- The value of the class property, converted to integer, or, if that class property is not set, defaultValue
- Throws:
NumberFormatException
- The value of the class property could be parsed as an integer- See Also:
-
getClassProperty
- Returns:
- The value of the class property, or, if that class property is not set,
null
- See Also:
-
getClassProperty
@Nullable public static String getClassProperty(Class<?> targetClass, String classPropertyName, @Nullable String defaultValue) Gets the value of a "class property".A class property is configured by a set of system properties (decreasing priority):
- fully-qualified-name-of-targetClass
.
classPropertyName - simple-name-of-targetClass
.
classPropertyName
- Returns:
- The value of the class property, or, if that class property is not set, defaultValue
- fully-qualified-name-of-targetClass
-