- All Superinterfaces:
Resolver,WithPriority
- All Known Implementing Classes:
NamedArgument.SetValueResolver,ReflectionValueResolver,ValueResolvers.ArrayResolver,ValueResolvers.CollectionResolver,ValueResolvers.EqualsResolver,ValueResolvers.ListResolver,ValueResolvers.LogicalAndResolver,ValueResolvers.LogicalOrResolver,ValueResolvers.MapEntryResolver,ValueResolvers.MapperResolver,ValueResolvers.MapResolver,ValueResolvers.MinusResolver,ValueResolvers.ModResolver,ValueResolvers.NumberValueResolver,ValueResolvers.OrEmptyResolver,ValueResolvers.OrResolver,ValueResolvers.PlusResolver,ValueResolvers.RawResolver,ValueResolvers.ThisResolver,ValueResolvers.TrueResolver
First the resolvers that apply to the given EvalContext are filtered. Then the resolver with highest priority is used
to resolve the data. If a Results.NotFound object is returned then the next available resolver is
used instead. However,
null return value is considered a valid result.
- See Also:
-
Field Summary
Fields inherited from interface io.quarkus.qute.WithPriority
DEFAULT_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanappliesTo(EvalContext context) static ValueResolverBuilderbuilder()default ValueResolvergetCachedResolver(EvalContext context) WhenappliesTo(EvalContext)returnstruefor a specificEvalContextand the subsequent invocation ofResolver.resolve(EvalContext)does not returnthe value resolver returned from this method is cached for the specific part of an expression.invalid reference
Results#NotFounddefault intValue resolvers with higher priority take precedence.Returns the set of method signatures supported by this value resolver for code completion in the Qute debugger.Returns the set of property names supported by this value resolver for code completion in the Qute debugger.static booleanmatchClass(EvalContext ctx, Class<?> clazz)
-
Method Details
-
getPriority
default int getPriority()Value resolvers with higher priority take precedence.- Specified by:
getPriorityin interfaceWithPriority- Returns:
- the priority value
-
appliesTo
- Parameters:
context-- Returns:
trueif this resolver applies to the given context
-
getCachedResolver
WhenappliesTo(EvalContext)returnstruefor a specificEvalContextand the subsequent invocation ofResolver.resolve(EvalContext)does not returnthe value resolver returned from this method is cached for the specific part of an expression.invalid reference
Results#NotFoundBy default, the resolver itself is cached. However, it is also possible to return an optimized version.
- Parameters:
context-- Returns:
- the resolver that should be cached
-
getSupportedProperties
Returns the set of property names supported by this value resolver for code completion in the Qute debugger.These properties are suggested when evaluating expressions on a base object. For example, if the user invokes completion at
myList.|, the evaluation context will be initialized withmyListas the base object, andappliesTowill be called with that context. Only if it returnstruewill the properties from this set be proposed.Completion examples:
"length"→ inserts as-is:myList.length|"size"→ inserts as-is:myList.size|
Example:
@Override public Set<String> getSupportedProperties() { return Set.of("length", "size"); }- Returns:
- a set of supported property names to be shown in the debugger's code completion
-
getSupportedMethods
Returns the set of method signatures supported by this value resolver for code completion in the Qute debugger.These methods are suggested when evaluating expressions on a base object. For example, if the user invokes completion at
myList.|, the evaluation context will be initialized withmyListas the base object, andappliesTowill be called with that context. Only if it returnstruewill the methods from this set be proposed.Completion examples:
"take(index)"→ inserts as-is:myList.take(index)|"takeLast(${index})"→ inserts with the parameter selected:myList.takeLast(|[index])
The
${param}syntax indicates that the debugger selects the parameter so the user can type it immediately.Example:
@Override public Set<String> getSupportedMethods() { return Set.of("take(index)", "takeLast(${index})"); }- Returns:
- a set of supported method signatures to be shown in the debugger's code completion
-
builder
- Returns:
- a new builder
-
matchClass
-