public interface EnhancedResolver extends Resolver
EnhancedResolver.Hint
for a
sucessfully resolved context object and name.
Note that hints may not always give better results. E.g. if we have a tag
{{foo.bar}}
and first we pass data where foo is resolved as a
map and then another data where foo is resolved as an integer, the hint
created for the map will not work for integer. In this case, the hint should
inform that it's not applicable and the resolver chain will be used to
resolve the value.
EngineConfigurationKey.RESOLVER_HINTS_ENABLED
can be used to disable
the hints entirely.
EngineConfigurationKey.RESOLVER_HINTS_ENABLED
Modifier and Type | Interface and Description |
---|---|
static interface |
EnhancedResolver.Hint
A hint could be used to skip the resolver chain for a part of the key of
a specific tag.
|
DEFAULT_PRIORITY
Modifier and Type | Method and Description |
---|---|
EnhancedResolver.Hint |
createHint(Object contextObject,
String name,
ResolutionContext context)
This method may only be called right after the
Resolver.resolve(Object, String, ResolutionContext) of the same resolver
returns a non-null value. |
getPriority, resolve
getConfigurationKeys, init
EnhancedResolver.Hint createHint(Object contextObject, String name, ResolutionContext context)
Resolver.resolve(Object, String, ResolutionContext)
of the same resolver
returns a non-null value. The parameters must be the same.
The created hint is currently only used to skip the resolver chain for
the first part of a key of a variable tag, i.e. foo
for
{{foo}}
or {{foo.bar}}
.
This method must not return null
.
contextObject
- name
- context
- Hints.INAPPLICABLE_HINT
Copyright © 2017. All rights reserved.