⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashenddetector.java

📁 Jamon是一个Java文本模板引擎
💻 JAVA
字号:
package org.jamon.parser;import org.jamon.ParserError;import org.jamon.node.Location;/** * A {@code TagEndDetector} which will end either on a "%>" sequence or a hash sign ("#"). */public class HashEndDetector implements TagEndDetector{    public int checkEnd(char p_char)    {        switch (p_char)        {            case '%' :                seenPercent = true;                return 0;            case '>' :                if (seenPercent)                {                    endedWithHash = false;                    return 2;                }                else                {                   seenPercent = false;                   return 0;                }            case '#' :                endedWithHash = true;                return 1;            default :               seenPercent = false;               return 0;        }    }    public ParserError getEofError(Location p_startLocation)    {        return new ParserError(p_startLocation, AbstractBodyParser.PERCENT_GREATER_THAN_EOF_ERROR);    }    public void resetEndMatch() {}    /**     * @return {@code true} if the final character read was a hash ("#"), false if it was a "%>"     * sequence.     */    public boolean endedWithHash()    {        return endedWithHash;    }    private boolean endedWithHash = false;    private boolean seenPercent = false;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -