Package com.github.jknack.handlebars
Interface ValueResolver
- All Known Implementing Classes:
FieldValueResolver,JavaBeanValueResolver,MapValueResolver,MemberValueResolver,MethodValueResolver
public interface ValueResolver
A hook interface for resolving values from the
context stack.- Since:
- 0.1.1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ValueResolver> Default value resolvers.propertySet(Object context) List all the properties and their values for the given object.Resolve the the context object by optionally converting the value if necessary.Resolve the attribute's name in the context object.
-
Field Details
-
UNRESOLVED
A mark object.
-
-
Method Details
-
resolve
Resolve the attribute's name in the context object. If aUNRESOLVEDis returned, thecontext stackwill continue with the next value resolver in the chain.- Parameters:
context- The context object. Not null.name- The attribute's name. Not null.- Returns:
- A
UNRESOLVEDis returned, thecontext stackwill continue with the next value resolver in the chain. Otherwise, it returns the associated value.
-
resolve
Resolve the the context object by optionally converting the value if necessary. If aUNRESOLVEDis returned, thecontext stackwill continue with the next value resolver in the chain.- Parameters:
context- The context object. Not null.- Returns:
- A
UNRESOLVEDis returned, thecontext stackwill continue with the next value resolver in the chain. Otherwise, it returns the associated value.
-
propertySet
List all the properties and their values for the given object.- Parameters:
context- The context object. Not null.- Returns:
- All the properties and their values for the given object.
-
defaultValueResolvers
Default value resolvers. Including: -MapValueResolver-JavaBeanValueResolver-MethodValueResolver. On Java 14 or higher.- Returns:
- Immutable list of value resolvers.
-