Skip to content

Commit 90df034

Browse files
committed
chore: add a getter for java method in ReflectionRoute
this allows to setup a more complex authorization/permission system with AnnotationAround
1 parent 71afd55 commit 90df034

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/main/java/net/codestory/http/routes/ReflectionRoute.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
*/
1616
package net.codestory.http.routes;
1717

18-
import java.io.*;
19-
import java.lang.reflect.*;
20-
import java.util.function.*;
18+
import net.codestory.http.Context;
19+
import net.codestory.http.annotations.MethodAnnotations;
20+
import net.codestory.http.annotations.Produces;
21+
import net.codestory.http.convert.TypeConvert;
22+
import net.codestory.http.payload.Payload;
2123

22-
import net.codestory.http.*;
23-
import net.codestory.http.annotations.*;
24-
import net.codestory.http.convert.*;
25-
import net.codestory.http.payload.*;
24+
import java.io.IOException;
25+
import java.lang.reflect.InvocationTargetException;
26+
import java.lang.reflect.Method;
27+
import java.lang.reflect.Type;
28+
import java.util.function.Supplier;
2629

2730
class ReflectionRoute implements AnyRoute {
2831
private final Supplier<Object> resource;
@@ -60,6 +63,8 @@ public Object body(Context context, String[] pathParameters) {
6063
});
6164
}
6265

66+
public Method javaMethod() {return method;}
67+
6368
static Object[] convert(Context context, String[] pathParameters, Type... types) throws IOException {
6469
Object[] converted = new Object[types.length];
6570

0 commit comments

Comments
 (0)