Class CLIExpressionResolver


  • public class CLIExpressionResolver
    extends Object
    Author:
    Alexey Loubyansky
    • Constructor Detail

      • CLIExpressionResolver

        public CLIExpressionResolver()
    • Method Detail

      • resolve

        public static String resolve​(String input)
                              throws UnresolvedExpressionException
        Attempts to substitute all the found expressions in the input with their corresponding resolved values. If any of the found expressions failed to resolve the exception will be thrown. If the input does not contain any expression, the input is returned as is.
        Parameters:
        input - the input string
        Returns:
        the input with resolved expressions
        Throws:
        UnresolvedExpressionException - in case an expression could not be resolved
      • resolveOrOriginal

        public static String resolveOrOriginal​(String input)
        Attempts to substitute all the found expressions in the input with their corresponding resolved values. If any of the found expressions failed to resolve or if the input does not contain any expression, the input is returned as is.
        Parameters:
        input - the input string
        Returns:
        the input with resolved expressions or the original input in case the input didn't contain any expressions or at least one of the expressions could not be resolved
      • resolveLax

        public static String resolveLax​(String input)
        Attempts to substitute all the found expressions in the input with their corresponding resolved values. If any of the found expressions failed to resolve, try to resolve expressions as more as possible and return the resolved value. If the input does not contain any expression, the input is returned as is. see https://issues.jboss.org/browse/WFCORE-1980,
        Parameters:
        input - the input string
        Returns:
        the input with resolved expressions or the original input in case the input didn't contain any expressions
      • resolveProperty

        public static String resolveProperty​(String input,
                                             int location,
                                             boolean exceptionIfNotResolved)
                                      throws UnresolvedExpressionException
        Parameters:
        location - the index of '$' starting the system property
        exceptionIfNotResolved - whether to ignore unresolved expression or throw an exception
        Returns:
        the index the parsing should continue from
        Throws:
        UnresolvedExpressionException - in case the expression could not be resolved