public final class Expression
extends java.lang.Object
${ ... }".| Modifier and Type | Class | Description |
|---|---|---|
static class |
Expression.Flag |
Flags that can apply to a property expression compilation
|
| Modifier and Type | Method | Description |
|---|---|---|
static Expression |
compile(java.lang.String string,
java.util.EnumSet<Expression.Flag> flags) |
Compile an expression string.
|
static Expression |
compile(java.lang.String string,
Expression.Flag... flags) |
Compile an expression string.
|
java.lang.String |
evaluate(java.util.function.BiConsumer<ResolveContext<java.lang.RuntimeException>,java.lang.StringBuilder> expandFunction) |
Evaluate the expression with the given expansion function.
|
<E extends java.lang.Exception> |
evaluateException(ExceptionBiConsumer<ResolveContext<E>,java.lang.StringBuilder,E> expandFunction) |
Evaluate the expression with the given expansion function, which may throw a checked exception.
|
java.lang.String |
evaluateWithEnvironment(boolean failOnNoDefault) |
Evaluate the expression using a default expansion function that evaluates environment properties.
|
java.lang.String |
evaluateWithProperties(boolean failOnNoDefault) |
Evaluate the expression using a default expansion function that evaluates system properties.
|
java.lang.String |
evaluateWithPropertiesAndEnvironment(boolean failOnNoDefault) |
Evaluate the expression using a default expansion function that evaluates system and environment properties
in the JBoss style (i.e.
|
java.util.Set<java.lang.String> |
getReferencedStrings() |
Get the immutable set of string keys that are referenced by expressions in this compiled expression.
|
public java.util.Set<java.lang.String> getReferencedStrings()
Expression.Flag.NO_RECURSE_KEY was not specified.null)public <E extends java.lang.Exception> java.lang.String evaluateException(ExceptionBiConsumer<ResolveContext<E>,java.lang.StringBuilder,E> expandFunction) throws E extends java.lang.Exception
true if the expansion succeeded or false if it failed (in which case
a default value may be used). If expansion succeeds, the expansion function should append the result to the
given StringBuilder.E - the exception type thrown by the expansion functionexpandFunction - the expansion function to apply (must not be null)E - if the expansion function throws an exceptionE extends java.lang.Exceptionpublic java.lang.String evaluate(java.util.function.BiConsumer<ResolveContext<java.lang.RuntimeException>,java.lang.StringBuilder> expandFunction)
true if the expansion succeeded or false if it failed (in which case
a default value may be used). If expansion succeeds, the expansion function should append the result to the
given StringBuilder.expandFunction - the expansion function to apply (must not be null)public java.lang.String evaluateWithPropertiesAndEnvironment(boolean failOnNoDefault)
"env." to designate an environment property).
The caller must have all required security manager permissions.failOnNoDefault - true to throw an IllegalArgumentException if an unresolvable key has no
default value; false to expand such keys to an empty stringpublic java.lang.String evaluateWithProperties(boolean failOnNoDefault)
failOnNoDefault - true to throw an IllegalArgumentException if an unresolvable key has no
default value; false to expand such keys to an empty stringpublic java.lang.String evaluateWithEnvironment(boolean failOnNoDefault)
failOnNoDefault - true to throw an IllegalArgumentException if an unresolvable key has no
default value; false to expand such keys to an empty stringpublic static Expression compile(java.lang.String string, Expression.Flag... flags)
string - the expression string (must not be null)flags - optional flags to apply which affect the compilationnull)public static Expression compile(java.lang.String string, java.util.EnumSet<Expression.Flag> flags)
string - the expression string (must not be null)flags - optional flags to apply which affect the compilation (must not be null)null)Copyright © 2018 JBoss, a division of Red Hat, Inc.