Package io.smallrye.common.expression
Class ResolveContext<E extends Exception>
- java.lang.Object
-
- io.smallrye.common.expression.ResolveContext<E>
-
- Type Parameters:
E- the exception type that can be thrown by the expansion function
public final class ResolveContext<E extends Exception> extends Object
The expression resolve context, which can be used to query the current expression key, write out expansions or default values, or perform validation.The expression context is not thread-safe and is not valid outside of the property expansion function body.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexpandDefault()Expand the default value to the current target string builder.voidexpandDefault(StringBuilder target)Expand the default value to the given string builder.StringgetExpandedDefault()Expand the default value to a string.StringgetKey()Get the expression resolution key, as a string.booleanhasDefault()Determine if the current expression has a default value.
-
-
-
Method Detail
-
getKey
public String getKey() throws E extends Exception
Get the expression resolution key, as a string. If the key contains an expression, it will have been expanded unlessExpression.Flag.NO_RECURSE_KEYwas given. The result is not cached and will be re-expanded every time this method is called.
-
expandDefault
public void expandDefault(StringBuilder target) throws E extends Exception
Expand the default value to the given string builder. If the default value contains an expression, it will have been expanded unlessExpression.Flag.NO_RECURSE_DEFAULTwas given. The result is not cached and will be re-expanded every time this method is called.
-
expandDefault
public void expandDefault() throws E extends ExceptionExpand the default value to the current target string builder. If the default value contains an expression, it will have been expanded unlessExpression.Flag.NO_RECURSE_DEFAULTwas given. The result is not cached and will be re-expanded every time this method is called.
-
getExpandedDefault
public String getExpandedDefault() throws E extends Exception
Expand the default value to a string. If the default value contains an expression, it will have been expanded unlessExpression.Flag.NO_RECURSE_DEFAULTwas given. The result is not cached and will be re-expanded every time this method is called.
-
hasDefault
public boolean hasDefault()
Determine if the current expression has a default value.- Returns:
trueif there is a default value,falseotherwise
-
-