Top Description Fields Constructors Methods
io.smallrye.common.expression

public final Class ResolveContext<E extends Exception>

extends Object
Class Inheritance
Type Parameters
<E>
the exception type that can be thrown by the expansion function
Imports
io.smallrye.common.function.ExceptionBiConsumer

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.

Field Summary

Modifier and TypeField and Description
private StringBuilder
private ExpressionNode
private final ExceptionBiConsumer<ResolveContext<E>, StringBuilder, E>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
emitToBuilder(final StringBuilder target, final Node node)

public void
expandDefault(StringBuilder
the string builder target
target
)

Expand the default value to the given string builder.

public void
expandDefault()

Expand the default value to the current target string builder.

public String

Returns:

the expanded string (not null)
getExpandedDefault
()

Expand the default value to a string.

public String

Returns:

the expanded key (not null)
getKey
()

Get the expression resolution key, as a string.

pack-priv StringBuilder
public boolean

Returns:

true if there is a default value, false otherwise
hasDefault
()

Determine if the current expression has a default value.

pack-priv ExpressionNode
setCurrent(final ExpressionNode current)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builderback to summary
private StringBuilder builder
currentback to summary
private ExpressionNode current
functionback to summary
private final ExceptionBiConsumer<ResolveContext<E>, StringBuilder, E> function

Constructor Detail

ResolveContextback to summary
pack-priv ResolveContext(final ExceptionBiConsumer<ResolveContext<E>, StringBuilder, E> function, final StringBuilder builder)

Method Detail

emitToBuilderback to summary
private void emitToBuilder(final StringBuilder target, final Node node) throws ResolveContext:E
expandDefaultback to summary
public void expandDefault(StringBuilder target) throws ResolveContext:E

Expand the default value to the given string builder. If the default value contains an expression, it will have been expanded unless Expression.Flag#NO_RECURSE_DEFAULT was given. The result is not cached and will be re-expanded every time this method is called.

Parameters
target:StringBuilder

the string builder target

Exceptions
ResolveContext:E:
if the recursive expansion threw an exception
expandDefaultback to summary
public void expandDefault() throws ResolveContext:E

Expand the default value to the current target string builder. If the default value contains an expression, it will have been expanded unless Expression.Flag#NO_RECURSE_DEFAULT was given. The result is not cached and will be re-expanded every time this method is called.

Exceptions
ResolveContext:E:
if the recursive expansion threw an exception
getExpandedDefaultback to summary
public String getExpandedDefault() throws ResolveContext:E

Expand the default value to a string. If the default value contains an expression, it will have been expanded unless Expression.Flag#NO_RECURSE_DEFAULT was given. The result is not cached and will be re-expanded every time this method is called.

Returns:String

the expanded string (not null)

Exceptions
ResolveContext:E:
if the recursive expansion threw an exception
getKeyback to summary
public String getKey() throws ResolveContext:E

Get the expression resolution key, as a string. If the key contains an expression, it will have been expanded unless Expression.Flag#NO_RECURSE_KEY was given. The result is not cached and will be re-expanded every time this method is called.

Returns:String

the expanded key (not null)

Exceptions
ResolveContext:E:
if the recursive expansion threw an exception
getStringBuilderback to summary
pack-priv StringBuilder getStringBuilder()
hasDefaultback to summary
public boolean hasDefault()

Determine if the current expression has a default value.

Returns:boolean

true if there is a default value, false otherwise

setCurrentback to summary
pack-priv ExpressionNode setCurrent(final ExpressionNode current)