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

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

?? compileunit.java

?? Groovy動態(tài)語言 運行在JVM中的動態(tài)語言 可以方便的處理業(yè)務邏輯變化大的業(yè)務
?? JAVA
字號:
/*
 * $Id: CompileUnit.java 4295 2006-12-02 21:15:54Z blackdrag $
 * 
 * Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
 * 
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided that the
 * following conditions are met:
 *  1. Redistributions of source code must retain copyright statements and
 * notices. Redistributions must also contain a copy of this document.
 *  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. The name "groovy" must not be used to endorse or promote products
 * derived from this Software without prior written permission of The Codehaus.
 * For written permission, please contact info@codehaus.org.
 *  4. Products derived from this Software may not be called "groovy" nor may
 * "groovy" appear in their names without prior written permission of The
 * Codehaus. "groovy" is a registered trademark of The Codehaus.
 *  5. Due credit should be given to The Codehaus - http://groovy.codehaus.org/
 * 
 * THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS ``AS IS'' AND ANY
 * EXPRESSED 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 THE CODEHAUS OR ITS 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 org.codehaus.groovy.ast;

import groovy.lang.GroovyClassLoader;

import java.security.CodeSource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.syntax.SyntaxException;

/**
 * Represents the entire contents of a compilation step which consists of one
 * or more {@link ModuleNode}instances
 * 
 * @author <a href="mailto:james@coredevelopers.net">James Strachan </a>
 * @version $Revision: 4295 $
 */
public class CompileUnit {

    private List modules = new ArrayList();
    private Map classes = new HashMap();
    private CompilerConfiguration config;
    private GroovyClassLoader classLoader;
    private CodeSource codeSource;
    private Map classesToCompile = new HashMap();
    private Map classNameToSource = new HashMap();
    
    public CompileUnit(GroovyClassLoader classLoader, CompilerConfiguration config) {
    	this(classLoader, null, config);
    }
    
    public CompileUnit(GroovyClassLoader classLoader, CodeSource codeSource, CompilerConfiguration config) {
        this.classLoader = classLoader;
        this.config = config;
        this.codeSource = codeSource;
    }

    public List getModules() {
        return modules;
    }

    public void addModule(ModuleNode node) {
        // node==null means a compilation error prevented
        // groovy from building an ast
        if (node==null) return;
        modules.add(node);
        node.setUnit(this);
        addClasses(node.getClasses());
    }

    /**
     * @return the ClassNode for the given qualified name or returns null if
     *         the name does not exist in the current compilation unit
     *         (ignoring the .class files on the classpath)
     */
    public ClassNode getClass(String name) {
        ClassNode cn = (ClassNode) classes.get(name);
        if (cn!=null) return cn;
        return (ClassNode) classesToCompile.get(name);
    }

    /**
     * @return a list of all the classes in each module in the compilation unit
     */
    public List getClasses() {
        List answer = new ArrayList();
        for (Iterator iter = modules.iterator(); iter.hasNext();) {
            ModuleNode module = (ModuleNode) iter.next();
            answer.addAll(module.getClasses());
        }
        return answer;
    }

    public CompilerConfiguration getConfig() {
        return config;
    }

    public GroovyClassLoader getClassLoader() {
        return classLoader;
    }
    
    public CodeSource getCodeSource() {
    	return codeSource;
    }

    /**
     * Appends all of the fully qualified class names in this
     * module into the given map
     */
    void addClasses(List classList) {
        for (Iterator iter = classList.iterator(); iter.hasNext();) {
            addClass((ClassNode) iter.next());
        }
    }
    
    /**
     *  Adds a class to the unit.
     */
    public void addClass(ClassNode node) {
    	node = node.redirect();
        String name = node.getName();
        ClassNode stored = (ClassNode) classes.get(name);
        if (stored != null && stored != node) {
            // we have a duplicate class!
            // One possibility for this is, that we delcared a script and a 
            // class in the same file and named the class like the file
            SourceUnit nodeSource = node.getModule().getContext();
            SourceUnit storedSource = stored.getModule().getContext();
            String txt = "Invalid duplicate class definition of class "+node.getName()+" : ";
            if (nodeSource==storedSource) {
                // same class in same source
                txt += "The source "+nodeSource.getName()+" contains at last two defintions of the class "+node.getName()+".\n";
                if (node.isScriptBody() || stored.isScriptBody()) {
                    txt += "One of the classes is a explicit generated class using the class statement, the other is a class generated from"+
                           " the script body based on the file name. Solutions are to change the file name or to change the class name.\n";
                }
            } else {
                txt += "The sources "+nodeSource.getName()+" and "+storedSource.getName()+" are containing both a class of the name "+node.getName()+".\n";
            }
            nodeSource.getErrorCollector().addErrorAndContinue(
                    new SyntaxErrorMessage(new SyntaxException(txt, node.getLineNumber(), node.getColumnNumber()), nodeSource)
            );
        }
        classes.put(name, node);
        
        if (classesToCompile.containsKey(name)) {
            ClassNode cn = (ClassNode) classesToCompile.get(name);
            cn.setRedirect(node);
            classesToCompile.remove(name);
        }        
    }
     
    /**
     * this emthod actually does not compile a class. It's only
     * a marker that this type has to be compiled by the CompilationUnit
     * at the end of a parse step no node should be be left.
     */
    public void addClassNodeToCompile(ClassNode node, SourceUnit location) {
        classesToCompile.put(node.getName(),node);
        classNameToSource.put(node.getName(),location);
    }
    
    public SourceUnit getScriptSourceLocation(String className) {
        return (SourceUnit) classNameToSource.get(className);
    }

    public boolean hasClassNodeToCompile(){
        return classesToCompile.size()!=0;
    }
    
    public Iterator iterateClassNodeToCompile(){
        return classesToCompile.keySet().iterator();
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕+乱码+中文字幕一区| 性感美女久久精品| 亚洲国产一区视频| 国产不卡一区视频| 91丨九色丨国产丨porny| 欧美一区二区私人影院日本| 1024成人网色www| 久久99蜜桃精品| 在线观看网站黄不卡| 久久综合网色—综合色88| 亚洲一区二区三区不卡国产欧美 | 在线视频一区二区三| 2017欧美狠狠色| 日本强好片久久久久久aaa| av电影天堂一区二区在线 | 国产伦精品一区二区三区免费迷| 色综合一个色综合亚洲| 久久久久成人黄色影片| 久久精品久久久精品美女| 91国模大尺度私拍在线视频| 国产精品丝袜91| 国产成人综合在线观看| 日韩欧美一级在线播放| 同产精品九九九| 欧美日韩在线播| 一区二区三区免费观看| 男人操女人的视频在线观看欧美| 欧洲国产伦久久久久久久| 久久久久国产精品厨房| 亚洲香肠在线观看| 99精品1区2区| 中文字幕在线观看一区二区| 国产美女久久久久| 91精品国产综合久久久久久| 国产精品传媒视频| 欧美一级黄色片| 99re热视频这里只精品| 另类小说一区二区三区| 亚洲精品中文在线观看| 精品少妇一区二区三区| 91成人免费网站| 国产激情精品久久久第一区二区| 亚洲一区二区三区不卡国产欧美| 国产三级久久久| 欧美肥妇bbw| 97精品久久久午夜一区二区三区| 久久成人久久鬼色| 一区二区三区小说| 国产欧美日韩久久| 日韩免费成人网| 91电影在线观看| 成人免费看片app下载| 久久黄色级2电影| 亚洲亚洲人成综合网络| 18成人在线观看| 久久久99久久精品欧美| 欧美一级片在线| 欧美系列日韩一区| 91啪亚洲精品| 福利一区福利二区| 国产一区二区三区在线观看免费视频 | 一区二区高清视频在线观看| 国产亚洲欧美激情| 精品国产精品一区二区夜夜嗨| 欧美日韩在线电影| 在线观看国产91| 在线亚洲一区二区| 一本色道综合亚洲| 97se亚洲国产综合自在线观| 国产白丝精品91爽爽久久| 激情六月婷婷久久| 久久99国内精品| 久久精品免费观看| 久久精品国产成人一区二区三区| 日本不卡视频在线| 日本不卡视频一二三区| 丝袜亚洲另类欧美| 日本中文字幕一区二区有限公司| 亚洲午夜精品网| 午夜视频在线观看一区二区三区| 亚洲一区在线观看视频| 亚洲一区二区高清| 亚洲国产视频直播| 日本人妖一区二区| 久久99精品国产麻豆婷婷| 国产原创一区二区| 国产精品91一区二区| 国产不卡视频在线观看| 国产aⅴ综合色| 99久久综合国产精品| 色综合久久久久| 欧美图片一区二区三区| 欧美老人xxxx18| 欧美一区二视频| 精品国产一二三| 国产欧美日韩视频在线观看| 中文字幕一区二区三区在线观看| 亚洲一区二区三区在线看| 亚洲成人免费电影| 免费成人av在线| 黄色资源网久久资源365| 国产成人av在线影院| 色综合久久综合| 51午夜精品国产| 久久久美女艺术照精彩视频福利播放| 亚洲国产精品高清| 一区二区三区在线免费观看| 视频一区二区中文字幕| 国产一区二区导航在线播放| 白白色 亚洲乱淫| 欧美日本国产视频| 久久蜜桃一区二区| 亚洲精品国产无天堂网2021| 奇米一区二区三区| 成人一区二区三区| 欧美乱熟臀69xxxxxx| 精品电影一区二区三区| 亚洲人成在线观看一区二区| 性欧美疯狂xxxxbbbb| 国产经典欧美精品| 欧美日韩一区二区三区四区| 精品成人佐山爱一区二区| 亚洲欧美乱综合| 蜜桃一区二区三区四区| 97se狠狠狠综合亚洲狠狠| 欧美一级高清片| 日韩伦理免费电影| 九九久久精品视频| 91视频xxxx| 久久久久久久电影| 亚洲国产乱码最新视频| 福利91精品一区二区三区| 欧美丝袜第三区| 亚洲国产精品成人综合色在线婷婷| 亚洲国产精品人人做人人爽| 国产99久久久久久免费看农村| 欧美性受xxxx| 中文字幕亚洲欧美在线不卡| 免费观看久久久4p| 欧美在线不卡一区| 国产欧美一区二区三区在线看蜜臀| 五月激情丁香一区二区三区| 国产精品一二三区在线| 日韩一区二区三区在线| 亚洲一区二区三区中文字幕在线 | 欧美色视频在线| 久久免费电影网| 蜜桃视频在线一区| 欧美色中文字幕| 亚洲欧美欧美一区二区三区| 成人免费视频播放| 久久免费美女视频| 久久精品国产色蜜蜜麻豆| 欧美久久久一区| 亚洲国产视频直播| 在线国产电影不卡| 亚洲女同女同女同女同女同69| 国产精品夜夜爽| 久久综合色天天久久综合图片| 免费观看在线色综合| 91麻豆精品国产91久久久资源速度| 一级中文字幕一区二区| 色综合中文字幕国产| 国产婷婷色一区二区三区| 精品一区二区三区香蕉蜜桃| 欧美一二三区在线| 免费日本视频一区| 欧美一区二区精美| 日本伊人午夜精品| 91麻豆精品国产91久久久久久久久 | 成人精品免费看| 中文一区二区完整视频在线观看| 国产成人av电影| 国产精品伦一区二区三级视频| 国产精品中文有码| 日本一区二区不卡视频| 成人综合在线观看| 一色屋精品亚洲香蕉网站| 99精品国产一区二区三区不卡| 综合欧美一区二区三区| 色综合久久久久综合99| 亚洲国产美女搞黄色| 欧美久久一二三四区| 美女网站在线免费欧美精品| 久久亚洲精精品中文字幕早川悠里| 国产精品一二三四区| 国产精品大尺度| 在线视频国产一区| 五月激情六月综合| 精品国产一二三| 成人av电影在线网| 亚洲一卡二卡三卡四卡无卡久久| 欧美三级韩国三级日本一级| 蜜桃久久精品一区二区| 久久午夜羞羞影院免费观看| 国产aⅴ综合色| 亚洲国产精品自拍| 亚洲精品在线一区二区| 成人免费视频一区| 亚洲一区二区三区视频在线播放 |