Package org.jboss.as.cli.util
Class CLIExpressionResolver
- java.lang.Object
-
- org.jboss.as.cli.util.CLIExpressionResolver
-
public class CLIExpressionResolver extends Object
- Author:
- Alexey Loubyansky
-
-
Constructor Summary
Constructors Constructor Description CLIExpressionResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringresolve(String input)Attempts to substitute all the found expressions in the input with their corresponding resolved values.static StringresolveLax(String input)Attempts to substitute all the found expressions in the input with their corresponding resolved values.static StringresolveOrOriginal(String input)Attempts to substitute all the found expressions in the input with their corresponding resolved values.static StringresolveProperty(String input, int location, boolean exceptionIfNotResolved)
-
-
-
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 propertyexceptionIfNotResolved- 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
-
-