org.codehaus.plexus.interpolation.util
Class ValueSourceUtils

java.lang.Object
  extended by org.codehaus.plexus.interpolation.util.ValueSourceUtils

public final class ValueSourceUtils
extends Object

Utility methods shared by multiple ValueSource implementations.

Version:
$Id$
Author:
jdcasey

Method Summary
static String trimPrefix(String expression, Collection<String> possiblePrefixes, boolean allowUnprefixedExpressions)
          If the expression starts with one of the provided prefixes, trim that prefix and return the remaining expression.
static String trimPrefix(String expression, String[] possiblePrefixes, boolean allowUnprefixedExpressions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

trimPrefix

public static String trimPrefix(String expression,
                                Collection<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 trim
possiblePrefixes - The list of possible expression prefixes to trim
allowUnprefixedExpressions - 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 String trimPrefix(String expression,
                                String[] possiblePrefixes,
                                boolean allowUnprefixedExpressions)


Copyright © 2001-2014 Codehaus. All Rights Reserved.