1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.eclipse.jetty.annotations;
15
16 import java.util.List;
17
18 import org.eclipse.jetty.annotations.AnnotationParser.DiscoverableAnnotationHandler;
19 import org.eclipse.jetty.annotations.AnnotationParser.Value;
20 import org.eclipse.jetty.util.log.Log;
21 import org.eclipse.jetty.webapp.DiscoveredAnnotation;
22 import org.eclipse.jetty.webapp.WebAppContext;
23
24
25
26
27
28
29
30 public class WebServletAnnotationHandler extends AbstractDiscoverableAnnotationHandler
31 {
32
33 public WebServletAnnotationHandler (WebAppContext context)
34 {
35 super(context);
36 }
37
38
39
40
41
42
43
44
45 public void handleClass(String className, int version, int access, String signature, String superName, String[] interfaces, String annotationName,
46 List<Value> values)
47 {
48 if (!"javax.servlet.annotation.WebServlet".equals(annotationName))
49 return;
50
51 WebServletAnnotation annotation = new WebServletAnnotation (_context, className);
52 addAnnotation(annotation);
53 }
54
55 public void handleField(String className, String fieldName, int access, String fieldType, String signature, Object value, String annotation,
56 List<Value> values)
57 {
58 Log.warn ("@WebServlet annotation not supported for fields");
59 }
60
61 public void handleMethod(String className, String methodName, int access, String params, String signature, String[] exceptions, String annotation,
62 List<Value> values)
63 {
64 Log.warn ("@WebServlet annotation not supported for methods");
65 }
66 }