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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女久久久久aⅴ国产馆| 国产精品一级片在线观看| 91丝袜高跟美女视频| 国产精品青草久久| 不卡电影免费在线播放一区| 成人免费在线视频观看| 色综合一区二区| 午夜a成v人精品| 精品国产91洋老外米糕| 国产suv一区二区三区88区| 国产人久久人人人人爽| 成人禁用看黄a在线| 亚洲欧美一区二区三区极速播放| 色av综合在线| 麻豆国产欧美日韩综合精品二区| 久久久久久久性| 91麻豆高清视频| 日韩电影一二三区| 国产丝袜在线精品| 91福利精品第一导航| 老色鬼精品视频在线观看播放| 2024国产精品| 91亚洲国产成人精品一区二区三| 亚洲综合色区另类av| 精品久久久久久久久久久久包黑料| 国产精一区二区三区| 亚洲影视在线播放| 精品三级在线观看| 色综合色狠狠综合色| 开心九九激情九九欧美日韩精美视频电影 | 欧美日韩精品欧美日韩精品| 久久精品国产免费| **性色生活片久久毛片| 7777女厕盗摄久久久| 国产成人aaaa| 日韩高清国产一区在线| 亚洲天堂网中文字| 久久久午夜精品理论片中文字幕| 日本久久电影网| 国产乱码精品一区二区三区av | 欧美日韩视频在线观看一区二区三区 | 国产精品影视天天线| 亚洲黄色免费电影| 国产午夜精品在线观看| 777欧美精品| 色天天综合久久久久综合片| 99国产精品久久久久久久久久久| 午夜精品视频在线观看| 亚洲欧美在线另类| 久久先锋影音av| 欧美日韩1234| 色噜噜狠狠成人中文综合| 国产成人精品亚洲日本在线桃色| 日韩va亚洲va欧美va久久| 亚洲精品国产a久久久久久| 久久精品一二三| 日韩欧美国产麻豆| 欧美精选在线播放| 欧美在线三级电影| 99re成人精品视频| 国产91露脸合集magnet | 久久草av在线| 丝袜美腿成人在线| 亚洲国产日产av| 1区2区3区欧美| 欧美激情综合五月色丁香小说| 日韩你懂的电影在线观看| 欧美日韩国产在线观看| 91久久精品一区二区三| 成人黄色av电影| 国产黄色91视频| 久久精品国产成人一区二区三区| 日韩一区欧美二区| 五月天精品一区二区三区| 亚洲国产精品视频| 亚洲成av人在线观看| 夜夜爽夜夜爽精品视频| 亚洲一区二区三区在线| 一区二区成人在线视频 | 久久美女高清视频 | 国产无人区一区二区三区| 欧美tk—视频vk| 精品播放一区二区| 久久久午夜精品理论片中文字幕| 久久这里只精品最新地址| 精品欧美乱码久久久久久1区2区| 欧美一级在线观看| 精品日韩在线一区| 精品国产91亚洲一区二区三区婷婷| 日韩一区二区免费在线观看| 欧美一级片在线观看| 91精品国产乱码久久蜜臀| 日韩欧美你懂的| 久久久久久亚洲综合| 中文字幕 久热精品 视频在线 | 欧美不卡123| 久久在线观看免费| 欧美激情在线看| 亚洲天堂中文字幕| 亚洲午夜精品网| 日韩av在线免费观看不卡| 精久久久久久久久久久| 国产.欧美.日韩| 色综合咪咪久久| 欧美女孩性生活视频| 欧美va在线播放| 国产精品丝袜一区| 亚洲电影一级片| 美女视频黄a大片欧美| 成人小视频在线观看| 日本韩国一区二区三区| 欧美日韩成人激情| 国产午夜精品久久久久久免费视| 蜜臀a∨国产成人精品| 久久99精品久久久久久国产越南 | 性欧美疯狂xxxxbbbb| 蜜桃视频在线一区| 不卡av在线免费观看| 欧美日韩国产区一| 国产三级精品三级| 亚洲电影第三页| 国产精品一卡二卡| 欧美探花视频资源| 久久夜色精品国产噜噜av| 亚洲天堂免费看| 美女一区二区在线观看| 91香蕉视频mp4| 日韩免费在线观看| 亚洲综合自拍偷拍| 国产精品一品二品| 欧美电影一区二区| 亚洲人精品一区| 国产精一品亚洲二区在线视频| 91精品办公室少妇高潮对白| xfplay精品久久| 午夜精品久久久久久久99樱桃| 国产黑丝在线一区二区三区| 欧美日韩国产不卡| 中文字幕一区二区三区在线播放| 日本不卡视频一二三区| 91浏览器在线视频| 国产精品麻豆欧美日韩ww| 九色综合国产一区二区三区| 欧美日韩一区二区三区四区五区| 亚洲国产成人自拍| 久久精品国产99国产| 精品视频123区在线观看| 综合分类小说区另类春色亚洲小说欧美 | 精品国产乱码久久久久久牛牛 | 亚洲三级小视频| 国产91精品一区二区麻豆网站| 久久久久久黄色| 激情欧美一区二区三区在线观看| 日韩精品一区二区三区四区| 久久成人综合网| 久久综合五月天婷婷伊人| 国产又黄又大久久| 国产欧美日韩视频在线观看| 粉嫩在线一区二区三区视频| 日韩毛片一二三区| 在线免费观看日韩欧美| 亚洲成av人在线观看| 欧美一区二区三区日韩视频| 久久精品99久久久| 欧美激情一区二区三区不卡| 色综合婷婷久久| 日韩电影在线一区二区| 久久夜色精品一区| 一本大道久久a久久综合| 午夜精品久久久久久不卡8050| 91精品国产高清一区二区三区蜜臀| 精品一区二区在线观看| 国产精品素人视频| 欧美日韩国产中文| 狠狠色丁香久久婷婷综| 国产精品久久福利| 亚洲精品在线电影| av成人老司机| 秋霞国产午夜精品免费视频| 国产精品三级电影| 欧美高清你懂得| 顶级嫩模精品视频在线看| 亚洲一区二区三区不卡国产欧美| 日韩视频永久免费| 色悠悠久久综合| 久久福利视频一区二区| 亚洲精品视频免费观看| 精品免费视频一区二区| 色综合色综合色综合| 激情丁香综合五月| 亚洲一区二区在线播放相泽 | 久久一二三国产| 91国偷自产一区二区三区成为亚洲经典| 日本 国产 欧美色综合| 亚洲天堂av一区| 26uuu色噜噜精品一区| 欧美剧在线免费观看网站| 成人av在线资源网站| 六月丁香综合在线视频| 一区二区久久久久久|