亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? codeviewer.java

?? 這是學習Java必須讀懂兩套源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * CodeViewer.java
 * CoolServlets.com
 * July 17, 2000
 *
 * Copyright (C) 2000 CoolServlets.com
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1) Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * 2) Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 * 3) Neither the name CoolServlets.com nor the names of its contributors may be
 *   used to endorse or promote products derived from this software without
 *   specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL COOLSERVLETS.COM OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package com.Yasna.codeviewer;

import java.util.*;

/**
 * A class that syntax highlights Java code into html.
 * <p>
 * A CodeViewer object is created and then keeps state as
 * lines are passed in. Each line passed in as java text, is returned as syntax
 * highlighted html text.
 * <p>
 * Users of the class can set how the java code will be highlighted with
 * setter methods.
 * <p>
 * Only valid java lines should be passed in since the object maintains
 * state and may not handle illegal code gracefully.
 * <p>
 * The actual system is implemented as a series of filters that deal with
 * specific portions of the java code. The filters are as follows:
 * <p>
 * <pre>
 *  htmlFilter
 *     |__
 *        multiLineCommentFilter
 *           |___
 *                inlineCommentFilter
 *                   |___
 *                        stringFilter
 *                           |__
 *                               keywordFilter
 * </pre>
 *
 */
public class CodeViewer {

    //private static HashMap reservedWords = new HashMap(80); // >= Java2 only (also, not thread-safe)
    private static Hashtable reservedWords = new Hashtable(80); // < Java2 (thread-safe)
    private boolean inMultiLineComment = false;
    private String backgroundColor = "#ffffff";
    private String commentStart = "<font color=\"#aa0000\"><i>";
    private String commentEnd = "</font></i>";
    private String stringStart = "<font color=\"#000099\">";
    private String stringEnd = "</font>";
    private String reservedWordStart = "<b>";
    private String reservedWordEnd = "</b>";

    /**
     * Load all keywords at class loading time.
     */
    static {
        loadKeywords();
    }

    /**
     * Gets the html for the start of a comment block.
     */
    public String getCommentStart() {
        return commentStart;
    }

    /**
     * Sets the html for the start of a comment block.
     */
    public void setCommentStart(String commentStart) {
        this.commentStart = commentStart;
    }

    /**
     * Gets the html for the end of a comment block.
     */
    public String getCommentEnd() {
        return commentEnd;
    }

    /**
     * Sets the html for the end of a comment block.
     */
    public void setCommentEnd(String commentEnd) {
        this.commentEnd = commentEnd;
    }

    /**
     * Gets the html for the start of a String.
     */
    public String getStringStart() {
        return stringStart;
    }

    /**
     * Sets the html for the start of a String.
     */
    public void setStringStart(String stringStart) {
        this.stringStart = stringStart;
    }

    /**
     * Gets the html for the end of a String.
     */
    public String getStringEnd() {
        return stringEnd;
    }

    /**
     * Sets the html for the end of a String.
     */
    public void setStringEnd(String stringEnd) {
        this.stringEnd = stringEnd;
    }

    /**
     * Gets the html for the start of a reserved word.
     */
    public String getReservedWordStart() {
        return reservedWordStart;
    }

    /**
     * Sets the html for the start of a reserved word.
     */
    public void setReservedWordStart(String reservedWordStart) {
        this.reservedWordStart = reservedWordStart;
    }

    /**
     * Gets the html for the end of a reserved word.
     */
    public String getReservedWordEnd() {
        return reservedWordEnd;
    }

    /**
     * Sets the html for the end of a reserved word.
     */
    public void setReservedWordEnd(String reservedWordEnd) {
        this.reservedWordEnd = reservedWordEnd;
    }

    /**
     * Passes off each line to the first filter.
     * @param   line    The line of Java code to be highlighted.
     */
    public String syntaxHighlight( String line ) {
       return htmlFilter(line);
    }

    /*
     * Filter html tags that appear in the java source into more benign text
     * that won't disrupt the output.
     */
    private String htmlFilter( String line ) {
        if( line == null || line.equals("") ) {
            return "";
        }
        // replace ampersands with HTML escape sequence for ampersand;
        line = replace(line, "&", "&#38;");

        // replace \" sequences with HTML escape sequences;
        line = replace(line, "\\\"", "&#92;&#34");

        // replace the \\ with HTML escape sequences. fixes a problem when
        // backslashes preceed quotes.
        line = replace(line, "\\\\", "&#92;&#92;" );

        // replace less-than signs which might be confused
        // by HTML as tag angle-brackets;
        line = replace(line, "<", "&#60;");
        // replace greater-than signs which might be confused
        // by HTML as tag angle-brackets;
        line = replace(line, ">", "&#62;");

        return multiLineCommentFilter(line);
    }

    /*
     * Filter out multiLine comments. State is kept with a private boolean
     * variable.
     */
    private String multiLineCommentFilter(String line) {
        if (line == null || line.equals("")) {
            return "";
        }
        StringBuffer buf = new StringBuffer();
        int index;
        //First, check for the end of a multi-line comment.
        if (inMultiLineComment && (index = line.indexOf("*/")) > -1 && !isInsideString(line,index)) {
            inMultiLineComment = false;
            buf.append(line.substring(0,index));
            buf.append("*/").append(commentEnd);
            if (line.length() > index+2) {
                buf.append(inlineCommentFilter(line.substring(index+2)));
            }
            return buf.toString();
        }
        //If there was no end detected and we're currently in a multi-line
        //comment, we don't want to do anymore work, so return line.
        else if (inMultiLineComment) {
            return line;
        }
        //We're not currently in a comment, so check to see if the start

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
51精品视频一区二区三区| 中文字幕中文乱码欧美一区二区| 欧美电视剧在线看免费| 中文字幕一区二区三区视频| 天堂影院一区二区| 国产高清不卡二三区| 欧美色成人综合| 国产欧美日韩在线看| 五月激情综合婷婷| 91在线视频观看| 久久久久久久久久久久久久久99 | 成人午夜激情片| 欧美一区二区在线看| 亚洲一区二区影院| 成人美女视频在线看| 亚洲精品一区二区精华| 日本成人在线视频网站| 在线一区二区观看| 亚洲另类在线制服丝袜| 国产91高潮流白浆在线麻豆 | 国产在线精品一区二区夜色 | 色综合网色综合| 中文字幕+乱码+中文字幕一区| 另类小说一区二区三区| 欧美美女bb生活片| 亚洲午夜激情网站| 色网综合在线观看| 亚洲免费av高清| 99精品久久久久久| 亚洲欧美另类在线| 色天使久久综合网天天| 亚洲蜜臀av乱码久久精品| 91亚洲资源网| 亚洲夂夂婷婷色拍ww47| 欧美日韩卡一卡二| 日本欧美久久久久免费播放网| 欧美高清www午色夜在线视频| 亚洲成人av福利| 91精品国产综合久久久蜜臀图片 | 亚洲一区二区三区四区五区黄| 一本色道亚洲精品aⅴ| 亚洲精品水蜜桃| 色94色欧美sute亚洲线路二| 一区二区在线观看免费视频播放| 91麻豆国产精品久久| 亚洲夂夂婷婷色拍ww47| 欧美高清视频一二三区 | 播五月开心婷婷综合| 国产精品二三区| 色呦呦国产精品| 亚洲国产精品久久人人爱蜜臀| 欧美视频在线一区二区三区| 亚洲成人久久影院| 精品国产一区久久| 成人午夜视频在线观看| 一区二区在线观看不卡| 91精品婷婷国产综合久久竹菊| 精品夜夜嗨av一区二区三区| 中文字幕欧美国产| 在线观看网站黄不卡| 蜜桃久久久久久久| 国产欧美久久久精品影院 | 国产精品羞羞答答xxdd| 国产精品护士白丝一区av| 日本丶国产丶欧美色综合| 日韩经典一区二区| 国产日韩欧美a| 欧美午夜视频网站| 国产一区二区三区精品视频| 亚洲丝袜另类动漫二区| 欧美卡1卡2卡| 成人精品国产免费网站| 婷婷开心激情综合| 中文字幕av一区 二区| 51精品国自产在线| jiyouzz国产精品久久| 免费不卡在线视频| 亚洲特黄一级片| 精品伦理精品一区| 91社区在线播放| 国产一区二区视频在线播放| 亚洲在线成人精品| 国产精品水嫩水嫩| 日韩欧美激情在线| 精品视频在线看| 成人av在线播放网址| 老司机精品视频在线| 亚洲图片另类小说| 久久久不卡网国产精品二区| 欧美日韩另类国产亚洲欧美一级| 成人黄色av电影| 国产综合色视频| 麻豆国产欧美一区二区三区| 亚洲区小说区图片区qvod| 欧美va亚洲va香蕉在线| 欧美精品九九99久久| 91在线高清观看| 成人综合日日夜夜| 韩国女主播一区| 日本在线不卡一区| 亚洲成av人片在www色猫咪| 国产精品传媒视频| 中文字幕精品在线不卡| 久久色成人在线| 精品国产sm最大网站免费看| 欧美日韩久久久久久| 欧美性极品少妇| 在线观看中文字幕不卡| 色综合天天综合| 91片在线免费观看| 99精品国产视频| 99久久亚洲一区二区三区青草| 粉嫩av一区二区三区在线播放| 极品尤物av久久免费看| 久久国产精品第一页| 精品一区二区三区久久| 老司机一区二区| 国产精品一二三四| 高清不卡一区二区在线| 粉嫩久久99精品久久久久久夜| 免费看日韩精品| 日韩黄色小视频| 秋霞成人午夜伦在线观看| 人禽交欧美网站| 久久精品久久精品| 国产又黄又大久久| 成人午夜在线视频| 色综合久久88色综合天天6 | 日韩欧美中文字幕一区| 欧美精品第一页| 久久综合九色综合97婷婷| 久久欧美一区二区| 中文字幕中文字幕一区| 一区二区三区日本| 日韩黄色片在线观看| 激情国产一区二区| 成人av动漫网站| 欧美伊人久久大香线蕉综合69| 欧美婷婷六月丁香综合色| 6080日韩午夜伦伦午夜伦| 精品日韩在线观看| 欧美经典一区二区| 一区二区三区在线不卡| 日本 国产 欧美色综合| 国产成人综合视频| 色婷婷av一区二区三区软件| 欧美精品vⅰdeose4hd| 国产人成一区二区三区影院| 综合在线观看色| 麻豆91在线看| 成人在线视频一区| 欧美日韩精品是欧美日韩精品| 精品日产卡一卡二卡麻豆| 中文字幕在线观看不卡| 亚洲国产精品麻豆| 成人丝袜18视频在线观看| 欧美性生活影院| 国产色婷婷亚洲99精品小说| 一区二区三区日韩欧美| 狠狠色狠狠色综合日日91app| 成人av电影在线网| 日韩欧美国产1| 亚洲夂夂婷婷色拍ww47| 国产主播一区二区三区| 91激情五月电影| 久久久久久久久蜜桃| 三级亚洲高清视频| 一本一道波多野结衣一区二区| 精品国产一区二区三区av性色| 亚洲美女视频在线| 国产精品一区二区久久不卡 | 91久久一区二区| 中文字幕欧美国产| 久久成人免费网| 欧美图区在线视频| 中文字幕一区二区三区不卡| 国产河南妇女毛片精品久久久| 91国产免费看| 亚洲人午夜精品天堂一二香蕉| 国产精品911| 精品国产乱码久久久久久图片| 亚洲小说春色综合另类电影| 成人app在线观看| 国产网站一区二区| 麻豆成人综合网| 欧美一区二区三区男人的天堂| 伊人开心综合网| 91免费在线看| 国产精品不卡在线观看| 国产一区二区伦理| 欧美大白屁股肥臀xxxxxx| 亚洲成av人片一区二区三区| 91丨porny丨首页| 中文字幕一区在线观看视频| 国产成人亚洲综合色影视 | 日韩精品一区二| 蜜桃久久久久久| 日韩美女在线视频 | 99re热这里只有精品免费视频 | 国产一区在线看|