Package org.wildfly.common.expression
Class Expression
java.lang.Object
org.wildfly.common.expression.Expression
Deprecated, for removal: This API element is subject to removal in a future version.
A compiled property-expansion expression string. An expression string is a mix of plain strings and expression
segments, which are wrapped by the sequence "
${ ... }".- Author:
- David M. Lloyd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated, for removal: This API element is subject to removal in a future version.Flags that can apply to a property expression compilation -
Method Summary
Modifier and TypeMethodDescriptionstatic Expressioncompile(String string, EnumSet<Expression.Flag> flags) Deprecated, for removal: This API element is subject to removal in a future version.Compile an expression string.static Expressioncompile(String string, Expression.Flag... flags) Deprecated, for removal: This API element is subject to removal in a future version.Compile an expression string.evaluate(BiConsumer<ResolveContext<RuntimeException>, StringBuilder> expandFunction) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression with the given expansion function.evaluateException(ExceptionBiConsumer<ResolveContext<E>, StringBuilder, E> expandFunction) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression with the given expansion function, which may throw a checked exception.evaluateWithEnvironment(boolean failOnNoDefault) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates environment properties.evaluateWithProperties(boolean failOnNoDefault) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates system properties.evaluateWithPropertiesAndEnvironment(boolean failOnNoDefault) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates system and environment properties in the JBoss style (i.e.Deprecated, for removal: This API element is subject to removal in a future version.Get the immutable set of string keys that are referenced by expressions in this compiled expression.
-
Method Details
-
getReferencedStrings
Deprecated, for removal: This API element is subject to removal in a future version.Get the immutable set of string keys that are referenced by expressions in this compiled expression. If there are no expansions in this expression, the set is empty. Note that this will not include any string keys that themselves contain expressions, in the case thatExpression.Flag.NO_RECURSE_KEYwas not specified.- Returns:
- the immutable set of strings (not
null)
-
evaluateException
public <E extends Exception> String evaluateException(ExceptionBiConsumer<ResolveContext<E>, StringBuilder, throws EE> expandFunction) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression with the given expansion function, which may throw a checked exception. The given "function" is a predicate which returnstrueif the expansion succeeded orfalseif it failed (in which case a default value may be used). If expansion succeeds, the expansion function should append the result to the givenStringBuilder.- Type Parameters:
E- the exception type thrown by the expansion function- Parameters:
expandFunction- the expansion function to apply (must not benull)- Returns:
- the expanded string
- Throws:
E- if the expansion function throws an exception
-
evaluate
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression with the given expansion function. The given "function" is a predicate which returnstrueif the expansion succeeded orfalseif it failed (in which case a default value may be used). If expansion succeeds, the expansion function should append the result to the givenStringBuilder.- Parameters:
expandFunction- the expansion function to apply (must not benull)- Returns:
- the expanded string
-
evaluateWithPropertiesAndEnvironment
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates system and environment properties in the JBoss style (i.e. using the prefix"env."to designate an environment property). The caller must have all required security manager permissions.- Parameters:
failOnNoDefault-trueto throw anIllegalArgumentExceptionif an unresolvable key has no default value;falseto expand such keys to an empty string- Returns:
- the expanded string
-
evaluateWithProperties
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates system properties. The caller must have all required security manager permissions.- Parameters:
failOnNoDefault-trueto throw anIllegalArgumentExceptionif an unresolvable key has no default value;falseto expand such keys to an empty string- Returns:
- the expanded string
-
evaluateWithEnvironment
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the expression using a default expansion function that evaluates environment properties. The caller must have all required security manager permissions.- Parameters:
failOnNoDefault-trueto throw anIllegalArgumentExceptionif an unresolvable key has no default value;falseto expand such keys to an empty string- Returns:
- the expanded string
-
compile
Deprecated, for removal: This API element is subject to removal in a future version.Compile an expression string.- Parameters:
string- the expression string (must not benull)flags- optional flags to apply which affect the compilation- Returns:
- the compiled expression (not
null)
-
compile
Deprecated, for removal: This API element is subject to removal in a future version.Compile an expression string.- Parameters:
string- the expression string (must not benull)flags- optional flags to apply which affect the compilation (must not benull)- Returns:
- the compiled expression (not
null)
-
Expressioninstead.