Class ConditionFunctions
java.lang.Object
org.apache.maven.impl.model.profile.ConditionFunctions
Provides a set of functions for evaluating profile activation conditions.
 These functions can be used in profile activation expressions to determine
 whether a profile should be activated based on various criteria.
- 
Constructor SummaryConstructorsConstructorDescriptionConditionFunctions(ProfileActivationContext context, VersionParser versionParser) Constructs a new ConditionFunctions instance.
- 
Method SummaryModifier and TypeMethodDescriptionChecks if a string contains a given substring.Checks if a file or directory exists at the given path.Implements an if-then-else operation.Finds the index of a substring within a string.Checks if a version is within a specified version range.Returns the length of the given string.Converts the given string to lowercase.Checks if a string matches a given regular expression.Checks if a file or directory is missing at the given path.Negates a boolean value.Returns a substring of the given string.Converts the given string to uppercase.
- 
Constructor Details- 
ConditionFunctionsConstructs a new ConditionFunctions instance.- Parameters:
- context- The profile activation context
- versionParser- The version parser for comparing versions
 
 
- 
- 
Method Details- 
lengthReturns the length of the given string.- Parameters:
- args- A list containing a single string argument
- Returns:
- The length of the string
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
 
- 
upperConverts the given string to uppercase.- Parameters:
- args- A list containing a single string argument
- Returns:
- The uppercase version of the input string
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
 
- 
lowerConverts the given string to lowercase.- Parameters:
- args- A list containing a single string argument
- Returns:
- The lowercase version of the input string
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
 
- 
substringReturns a substring of the given string.- Parameters:
- args- A list containing 2 or 3 arguments: the string, start index, and optionally end index
- Returns:
- The substring
- Throws:
- IllegalArgumentException- if the number of arguments is not 2 or 3
 
- 
indexOfFinds the index of a substring within a string.- Parameters:
- args- A list containing two strings: the main string and the substring to find
- Returns:
- The index of the substring, or -1 if not found
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly two
 
- 
containsChecks if a string contains a given substring.- Parameters:
- args- A list containing two strings: the main string and the substring to check
- Returns:
- true if the main string contains the substring, false otherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly two
 
- 
matchesChecks if a string matches a given regular expression.- Parameters:
- args- A list containing two strings: the string to check and the regex pattern
- Returns:
- true if the string matches the regex, false otherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly two
 
- 
notNegates a boolean value.- Parameters:
- args- A list containing a single boolean argument
- Returns:
- The negation of the input boolean
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
 
- 
if_Implements an if-then-else operation.- Parameters:
- args- A list containing three arguments: condition, value if true, value if false
- Returns:
- The second argument if the condition is true, the third argument otherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly three
 
- 
existsChecks if a file or directory exists at the given path.- Parameters:
- args- A list containing a single string argument representing the path
- Returns:
- trueif the file or directory exists,- falseotherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
- ModelBuilderException- if a problem occurs while walking the file system
- InterpolatorException- if an error occurs during interpolation
 
- 
missingChecks if a file or directory is missing at the given path.- Parameters:
- args- A list containing a single string argument representing the path
- Returns:
- trueif the file or directory does not exist,- falseotherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly one
- ModelBuilderException- if a problem occurs while walking the file system
- InterpolatorException- if an error occurs during interpolation
 
- 
inrangeChecks if a version is within a specified version range.- Parameters:
- args- A list containing two strings: the version to check and the version range
- Returns:
- true if the version is within the range, false otherwise
- Throws:
- IllegalArgumentException- if the number of arguments is not exactly two
 
 
-