Class ValueSourceUtils
- java.lang.Object
-
- org.codehaus.plexus.interpolation.util.ValueSourceUtils
-
public final class ValueSourceUtils extends java.lang.Object
Utility methods shared by multipleValueSource
implementations.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ValueSourceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
trimPrefix(java.lang.String expression, java.lang.String[] possiblePrefixes, boolean allowUnprefixedExpressions)
static java.lang.String
trimPrefix(java.lang.String expression, java.util.Collection<java.lang.String> possiblePrefixes, boolean allowUnprefixedExpressions)
If the expression starts with one of the provided prefixes, trim that prefix and return the remaining expression.
-
-
-
Method Detail
-
trimPrefix
public static java.lang.String trimPrefix(java.lang.String expression, java.util.Collection<java.lang.String> possiblePrefixes, boolean allowUnprefixedExpressions)
If the expression starts with one of the provided prefixes, trim that prefix and return the remaining expression. If it doesn't start with a provided prefix, and the allowUnprefixedExpressions flag is true, then return the expression unchanged; if the flag is false, return null. Finally, if the original expression is null, return null without attempting to process it.- Parameters:
expression
- The expression to trimpossiblePrefixes
- The list of possible expression prefixes to trimallowUnprefixedExpressions
- Whether to return the expression if it doesn't start with one of the prefixes. If true, simply return the original expression; if false, return null.- Returns:
- The trimmed expression, or null. See the behavior of allowUnprefixedExpressions in this method for more detail.
-
trimPrefix
public static java.lang.String trimPrefix(java.lang.String expression, java.lang.String[] possiblePrefixes, boolean allowUnprefixedExpressions)
-
-