KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > sourcetypehandlers > JspTypeHandler


1 package net.sourceforge.pmd.sourcetypehandlers;
2
3 import net.sourceforge.pmd.ast.ParseException;
4 import net.sourceforge.pmd.jsp.ast.JspCharStream;
5 import net.sourceforge.pmd.parsers.Parser;
6 import net.sourceforge.pmd.symboltable.JspSymbolFacade;
7
8 import java.io.Reader JavaDoc;
9 import java.util.HashMap JavaDoc;
10 import java.util.Map JavaDoc;
11
12 /**
13  * Implementation of SourceTypeHandler for the JSP parser.
14  *
15  * @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
16  */

17 public class JspTypeHandler implements SourceTypeHandler {
18     
19     public Parser getParser() {
20         return new Parser() {
21             public Object JavaDoc parse(Reader JavaDoc source) throws ParseException {
22                 return new net.sourceforge.pmd.jsp.ast.JspParser(new JspCharStream(source))
23                         .CompilationUnit();
24             }
25             public Map JavaDoc getExcludeMap() {
26                 return new HashMap JavaDoc();
27             }
28             public void setExcludeMarker(String JavaDoc marker) {}
29         };
30     }
31
32     public VisitorStarter getDataFlowFacade() {
33         return VisitorStarter.dummy;
34     }
35
36     public VisitorStarter getSymbolFacade() {
37         return new JspSymbolFacade();
38     }
39
40     public VisitorStarter getTypeResolutionFacade() {
41         return VisitorStarter.dummy;
42     }
43
44 }
45
Popular Tags