View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.xml;
5   
6   import java.io.Reader;
7   import java.util.HashMap;
8   import java.util.Map;
9   
10  import net.sourceforge.pmd.lang.AbstractParser;
11  import net.sourceforge.pmd.lang.ParserOptions;
12  import net.sourceforge.pmd.lang.TokenManager;
13  import net.sourceforge.pmd.lang.ast.Node;
14  import net.sourceforge.pmd.lang.ast.ParseException;
15  
16  /**
17   * Adapter for the XmlParser.
18   */
19  public class XmlParser extends AbstractParser {
20  
21      public XmlParser(ParserOptions parserOptions) {
22  	super(parserOptions);
23      }
24  
25      @Override
26      public TokenManager createTokenManager(Reader source) {
27  	return null;
28      }
29  
30      public boolean canParse() {
31  	return true;
32      }
33  
34      public Node parse(String fileName, Reader source) throws ParseException {
35  	return new net.sourceforge.pmd.lang.xml.ast.XmlParser((XmlParserOptions) parserOptions).parse(source);
36      }
37  
38      public Map<Integer, String> getSuppressMap() {
39  	return new HashMap<>(); // FIXME
40      }
41  }