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

nablarch.test.tool.sanitizingcheck.JspParser Maven / Gradle / Ivy

The newest version!
package nablarch.test.tool.sanitizingcheck;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import nablarch.test.tool.htmlcheck.util.FileUtil;
import nablarch.test.tool.sanitizingcheck.tag.Directive;
import nablarch.test.tool.sanitizingcheck.tag.ExpressionLang;
import nablarch.test.tool.sanitizingcheck.tag.HtmlComment;
import nablarch.test.tool.sanitizingcheck.tag.JspCore;
import nablarch.test.tool.sanitizingcheck.tag.SuppressJspCheck;
import nablarch.test.tool.sanitizingcheck.tag.Tag;
import nablarch.test.tool.sanitizingcheck.tag.TagLib;

/**
 * JSPファイルを解析する。
 *
 * @author hisaaki sioiri
 */
public class JspParser {

    /** チェック対象外を示す文字列 */
    private static final String SUPPRESS_JSP_CHECK_KEYWORD = "suppress jsp check";

    /** 解析対象のタグパターン */
    private static final Pattern TAG_PATTERN = Pattern.compile(
            "((<%@)\\s*(\\w+)"              // ディレクティブ
            + "|(