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
Author:
edgar.espina

Field Summary
static Object UNRESOLVED
          A mark object.
static ValueResolver[] VALUE_RESOLVERS
          The default value resolvers.
 
Method Summary
 Set<Map.Entry<String,Object>> propertySet(Object context)
          List all the properties and their values for the given object.
 Object resolve(Object context, String name)
          Resolve the attribute's name in the context object.
 

Field Detail

VALUE_RESOLVERS

static final ValueResolver[] VALUE_RESOLVERS
The default value resolvers.


UNRESOLVED

static final Object UNRESOLVED
A mark object.

Method Detail

resolve

Object resolve(Object context,
               String name)
Resolve the attribute's name in the context object. If a UNRESOLVED is returned, the context stack will 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 UNRESOLVED is returned, the context stack will continue with the next value resolver in the chain. Otherwise, it returns the associated value.

propertySet

Set<Map.Entry<String,Object>> propertySet(Object context)
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.


Copyright © 2012. All Rights Reserved.