public class ThisResolver extends AbstractResolver
EnhancedResolver.Hint
Modifier and Type | Field and Description |
---|---|
static String |
NAME_THIS |
static int |
THIS_RESOLVER_PRIORITY |
configuration
DEFAULT_PRIORITY
Constructor and Description |
---|
ThisResolver() |
ThisResolver(int 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. |
Object |
resolve(Object contextObject,
String name,
ResolutionContext context)
Resolve the value from specified context object and name.
|
getPriority, toString
checkNotInitialized, init, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConfigurationKeys, init
public static final int THIS_RESOLVER_PRIORITY
public static final String NAME_THIS
public ThisResolver()
public ThisResolver(int priority)
public Object resolve(Object contextObject, String name, ResolutionContext context)
Resolver
null
in case of the resolver is not capable
of resolving it.
ResolutionContext
allows to register a callback to release all
the relevant resources after the resolved value is used.
contextObject
- The current context object (aka base object), may be
null
name
- The name (the key or its part) is never null
context
- The current resolution contextnull
Placeholder.NULL
public EnhancedResolver.Hint createHint(Object contextObject, String name, ResolutionContext context)
EnhancedResolver
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
.
createHint
in interface EnhancedResolver
createHint
in class AbstractResolver
Hints.INAPPLICABLE_HINT
Copyright © 2017. All rights reserved.