|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.jknack.handlebars.context.MemberValueResolver<Method>
com.github.jknack.handlebars.context.MethodValueResolver
public class MethodValueResolver
A specialization of MemberValueResolver with lookup and invocation
support for Method.
It matches a public method.
| Field Summary | |
|---|---|
static ValueResolver |
INSTANCE
The default instance. |
| Fields inherited from interface com.github.jknack.handlebars.ValueResolver |
|---|
UNRESOLVED, VALUE_RESOLVERS |
| Constructor Summary | |
|---|---|
MethodValueResolver()
|
|
| Method Summary | |
|---|---|
protected Object |
invokeMember(Method member,
Object context)
Invoke the member in the given context. |
boolean |
matches(Method method,
String name)
True, if the member matches the one we look for. |
protected String |
memberName(Method member)
Get the name for the given member. |
protected Set<Method> |
members(Class<?> clazz)
List all the possible members for the given class. |
protected void |
members(Class<?> clazz,
Set<Method> members)
Collect all the method from the given class. |
| Methods inherited from class com.github.jknack.handlebars.context.MemberValueResolver |
|---|
find, isPrivate, isProtected, isPublic, isStatic, membersFromCache, propertySet, resolve |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ValueResolver INSTANCE
| Constructor Detail |
|---|
public MethodValueResolver()
| Method Detail |
|---|
public boolean matches(Method method,
String name)
MemberValueResolver
matches in class MemberValueResolver<Method>method - The class Member.name - The attribute's name.
protected Object invokeMember(Method member,
Object context)
MemberValueResolver
invokeMember in class MemberValueResolver<Method>member - The class member.context - The context object.
protected Set<Method> members(Class<?> clazz)
MemberValueResolver
members in class MemberValueResolver<Method>clazz - The base class.
protected void members(Class<?> clazz,
Set<Method> members)
clazz - The base class.members - The members result set.protected String memberName(Method member)
MemberValueResolver
memberName in class MemberValueResolver<Method>member - A class member.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||