All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.lang.html.ast.HtmlParser Maven / Gradle / Ivy

The newest version!
/*
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */


package net.sourceforge.pmd.lang.html.ast;

import java.util.HashMap;

import org.jsoup.nodes.Document;
import org.jsoup.parser.Parser;

public final class HtmlParser implements net.sourceforge.pmd.lang.ast.Parser {

    @Override
    public ASTHtmlDocument parse(ParserTask task) {
        Document doc = Parser.xmlParser().parseInput(task.getTextDocument().newReader(), task.getFileId().getUriString());
        HtmlTreeBuilder builder = new HtmlTreeBuilder();
        return builder.build(doc, task, new HashMap<>());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy