public class TransformResolver extends LocaleAwareResolver implements Transformer
Transformer
instance or
by the resolver itself.EnhancedResolver.Hint
configuration
DEFAULT_PRIORITY
Constructor and Description |
---|
TransformResolver(int priority,
String... matchNames) |
TransformResolver(int priority,
Transformer transformer,
String... matchingNames) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
matches(Object contextObject,
String name) |
protected boolean |
matches(String name) |
protected String |
matchingName(int index) |
protected Object |
performTransformation(Object contextObject,
String name,
ResolutionContext context) |
Object |
resolve(Object contextObject,
String name,
ResolutionContext context)
Resolve the value from specified context object and name.
|
protected void |
setMatchingNames(String... matchNames) |
Object |
transform(Object contextObject,
String name,
ResolutionContext context) |
getCurrentLocale, init
createHint, getPriority, toString
checkNotInitialized, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConfigurationKeys, init
public TransformResolver(int priority, String... matchNames)
priority
- matchNames
- public TransformResolver(int priority, Transformer transformer, String... matchingNames)
priority
- transformer
- matchingNames
- 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.
resolve
in interface Resolver
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 Object transform(Object contextObject, String name, ResolutionContext context)
transform
in interface Transformer
protected boolean matches(Object contextObject, String name)
contextObject
- name
- true
in case of the resolver matches given context
object and name, false
otherwiseprotected Object performTransformation(Object contextObject, String name, ResolutionContext context)
contextObject
- name
- context
- null
if the
transformation was not successfullprotected boolean matches(String name)
protected String matchingName(int index)
protected void setMatchingNames(String... matchNames)
Copyright © 2017. All rights reserved.