01: package net.sourceforge.pmd.sourcetypehandlers;
02:
03: import net.sourceforge.pmd.ast.ParseException;
04: import net.sourceforge.pmd.jsp.ast.JspCharStream;
05: import net.sourceforge.pmd.parsers.Parser;
06: import net.sourceforge.pmd.symboltable.JspSymbolFacade;
07:
08: import java.io.Reader;
09: 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(
23: new JspCharStream(source)).CompilationUnit();
24: }
25:
26: public Map<Integer, String> getExcludeMap() {
27: return new HashMap<Integer, String>();
28: }
29:
30: public void setExcludeMarker(String marker) {
31: }
32: };
33: }
34:
35: public VisitorStarter getDataFlowFacade() {
36: return VisitorStarter.dummy;
37: }
38:
39: public VisitorStarter getSymbolFacade() {
40: return new JspSymbolFacade();
41: }
42:
43: public VisitorStarter getTypeResolutionFacade(
44: ClassLoader classLoader) {
45: return VisitorStarter.dummy;
46: }
47:
48: }
|