3 import java
.lang
.reflect
.Method
;
4 import java
.lang
.reflect
.Modifier
;
5 import java
.util
.HashMap
;
8 public abstract class PathNode
implements RequestNode
{
10 public Map
<String
, Method
> methods() {
12 Map
<String
, Method
> methods
= new HashMap
<String
, Method
>();
14 for (Method m
: this.getClass().getMethods()) {
15 if (m
.getDeclaringClass() != this.getClass()) continue;
16 if (!RequestNode
.class.isAssignableFrom(m
.getReturnType())) continue;
17 if (m
.getParameterTypes().length
!= 0) continue;
18 if (m
.getModifiers() != Modifier
.PUBLIC
) continue;
19 methods
.put(m
.getName(), m
);