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;
9 import java.util.HashMap;
10 import java.util.Map;
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 parse(Reader source) throws ParseException {
22 return new net.sourceforge.pmd.jsp.ast.JspParser(new JspCharStream(source))
23 .CompilationUnit();
24 }
25 public Map getExcludeMap() {
26 return new HashMap();
27 }
28 public void setExcludeMarker(String 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 }