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

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

?? classnode.java

?? Groovy動態語言 運行在JVM中的動態語言 可以方便的處理業務邏輯變化大的業務
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * $Id: ClassNode.java 4216 2006-11-13 16:04:23Z 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.GroovyObject;

import org.codehaus.groovy.GroovyBugError;
import org.codehaus.groovy.ast.expr.Expression;
import org.codehaus.groovy.ast.expr.TupleExpression;
import org.codehaus.groovy.ast.stmt.BlockStatement;
import org.codehaus.groovy.ast.stmt.EmptyStatement;
import org.codehaus.groovy.ast.stmt.Statement;
import org.objectweb.asm.Opcodes;

import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Represents a class in the AST.<br/>
 * A ClassNode should be created using the methods in ClassHelper. 
 * This ClassNode may be used to represent a class declaration or
 * any other type. This class uses a proxy meschanism allowing to
 * create a class for a plain name at ast creation time. In another 
 * phase of the compiler the real ClassNode for the plain name may be
 * found. To avoid the need of exchanging this ClassNode with an 
 * instance of the correct ClassNode the correct ClassNode is set as 
 * redirect. All method calls are then redirected to that ClassNode.
 * <br>
 * Note: the proxy mechanism is only allowed for classes being marked
 * as primary ClassNode which means they represent no actual class. 
 * The redirect itself can be any type of ClassNode
 *
 * @see org.codehaus.groovy.ast.ClassHelper
 * 
 * @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
 * @author Jochen Theodorou
 * @version $Revision: 4216 $
 */
public class ClassNode extends AnnotatedNode implements Opcodes {

	public static ClassNode[] EMPTY_ARRAY = new ClassNode[0];
    
    public static ClassNode THIS = new ClassNode(Object.class);
    public static ClassNode SUPER = new ClassNode(Object.class);
    
    private String name;
    private int modifiers;
    private ClassNode[] interfaces;
    private MixinNode[] mixins;
    private List constructors = new ArrayList();
    private List  objectInitializers = new ArrayList();
    private List methods = new ArrayList();
    private List fields = new ArrayList();
    private List properties = new ArrayList();
    private Map fieldIndex = new HashMap();
    private ModuleNode module;
    private CompileUnit compileUnit;
    private boolean staticClass = false;
    private boolean scriptBody = false;
    private boolean script;
    private ClassNode superClass;
    boolean isPrimaryNode;
    
    // use this to synchronize access for the lazy intit
    protected Object lazyInitLock = new Object();

    // clazz!=null when resolved
    protected Class clazz;
    // only false when this classNode is constructed from a class 
    private boolean lazyInitDone=true;
    // not null if if the ClassNode is an array 
    private ClassNode componentType = null;
    // if not null this instance is handled as proxy 
    // for the redirect
    private ClassNode redirect=null; 
    
    /**
     * Returns the ClassNode this ClassNode is redirecting to.
     */
    protected ClassNode redirect(){
        if (redirect==null) return this;
        return redirect.redirect();
    }
    
    /**
     * Sets this instance as proxy for the given ClassNode. 
     * @param cn the class to redirect to. If set to null the redirect will be removed
     */
    public void setRedirect(ClassNode cn) {
        if (isPrimaryNode) throw new GroovyBugError("tried to set a redirect for a primary ClassNode ("+getName()+"->"+cn.getName()+").");
        if (cn!=null) cn = cn.redirect();
        redirect = cn;
    }
    
    /**
     * Returns a ClassNode representing an array of the class
     * represented by this ClassNode
     */
    public ClassNode makeArray() {
        if (redirect!=null) return redirect().makeArray();
        ClassNode cn;
        if (clazz!=null) {
            Class ret = Array.newInstance(clazz,0).getClass();
            // don't use the ClassHelper here!
            cn = new ClassNode(ret,this);
        } else {
            cn = new ClassNode(this);
        }
        return cn;
    }
    
    /**
     * Returns if this instance is a primary ClassNode
     */
    public boolean isPrimaryClassNode(){
    	return redirect().isPrimaryNode || (componentType!= null && componentType.isPrimaryClassNode());
    }
    
    /**
     * Constructor used by makeArray() if no real class is available
     */
    private ClassNode(ClassNode componentType) {
        this(componentType.getName()+"[]", ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
        this.componentType = componentType.redirect();
        isPrimaryNode=false;
    }
    
    /**
     * Constructor used by makeArray() if a real class is available
     */
    private ClassNode(Class c, ClassNode componentType) {
        this(c);
        this.componentType = componentType;
        isPrimaryNode=false;
    }
    
    /**
     * Creates a ClassNode from a real class. The resulting 
     * ClassNode will be no primary ClassNode.
     */
    public ClassNode(Class c) {
        this(c.getName(), c.getModifiers(), null, null ,MixinNode.EMPTY_ARRAY);
        clazz=c;
        lazyInitDone=false;
        CompileUnit cu = getCompileUnit();
        if (cu!=null) cu.addClass(this);
        isPrimaryNode=false;
    }    
    
    /**
     * The complete class structure will be initialized only when really
     * needed to avoid having too much objects during compilation
     */
    private void lazyClassInit() {       
        synchronized (lazyInitLock) {
            if (lazyInitDone) return;
            
            Field[] fields = clazz.getDeclaredFields();
            for (int i=0;i<fields.length;i++){
                addField(fields[i].getName(),fields[i].getModifiers(),this,null);
            }
            Method[] methods = clazz.getDeclaredMethods();
            for (int i=0;i<methods.length;i++){
                Method m = methods[i];
                MethodNode mn = new MethodNode(m.getName(), m.getModifiers(), ClassHelper.make(m.getReturnType()), createParameters(m.getParameterTypes()), ClassHelper.make(m.getExceptionTypes()), null);
                addMethod(mn);
            }
            Constructor[] constructors = clazz.getDeclaredConstructors();
            for (int i=0;i<constructors.length;i++){
                Constructor ctor = constructors[i];
                addConstructor(ctor.getModifiers(),createParameters(ctor.getParameterTypes()),ClassHelper.make(ctor.getExceptionTypes()),null);
            }
            Class sc = clazz.getSuperclass();
            if (sc!=null) superClass = ClassHelper.make(sc);
            buildInterfaceTypes(clazz);       
            lazyInitDone=true;
        }
    }
    
    private void buildInterfaceTypes(Class c) {
        Class[] interfaces = c.getInterfaces();
        ClassNode[] ret = new ClassNode[interfaces.length];
        for (int i=0;i<interfaces.length;i++){
            ret[i] = ClassHelper.make(interfaces[i]);
        }
        this.interfaces = ret;
    }
    
    
    // added to track the enclosing method for local inner classes
    private MethodNode enclosingMethod = null;

    public MethodNode getEnclosingMethod() {
        return redirect().enclosingMethod;
    }

    public void setEnclosingMethod(MethodNode enclosingMethod) {
        redirect().enclosingMethod = enclosingMethod;
    }


    /**
     * @param name       is the full name of the class
     * @param modifiers  the modifiers,
     * @param superClass the base class name - use "java.lang.Object" if no direct
     *                   base class
     * @see org.objectweb.asm.Opcodes
     */
    public ClassNode(String name, int modifiers, ClassNode superClass) {
        this(name, modifiers, superClass, ClassHelper.EMPTY_TYPE_ARRAY, MixinNode.EMPTY_ARRAY);
    }

    /**
     * @param name       is the full name of the class
     * @param modifiers  the modifiers,
     * @param superClass the base class name - use "java.lang.Object" if no direct
     *                   base class
     * @see org.objectweb.asm.Opcodes
     */
    public ClassNode(String name, int modifiers, ClassNode superClass, ClassNode[] interfaces, MixinNode[] mixins) {
        this.name = name;
        this.modifiers = modifiers;
        this.superClass = superClass;
        this.interfaces = interfaces;
        this.mixins = mixins;
        isPrimaryNode = true;
    }

    
    /**
     * Sets the superclass of this ClassNode
     */
    public void setSuperClass(ClassNode superClass) {
        redirect().superClass = superClass;
    }

    /**
     * Returns a list containing FieldNode objects for
     * each field in the class represented by this ClassNode
     */
    public List getFields() {
        if (!lazyInitDone) {
            lazyClassInit();
        }
        if (redirect!=null) return redirect().getFields();
        return fields;
    }

    /**
     * Returns an array of ClassNodes representing the
     * interfaces the class implements
     */
    public ClassNode[] getInterfaces() {
        if (!lazyInitDone) {
            lazyClassInit();
        }
        if (redirect!=null) return redirect().getInterfaces();
        return interfaces;
    }

    public MixinNode[] getMixins() {
        return redirect().mixins;
    }

    /**
     * Returns a list containing MethodNode objects for
     * each method in the class represented by this ClassNode
     */    
    public List getMethods() {
        if (!lazyInitDone) {
            lazyClassInit();
        }
        if (redirect!=null) return redirect().getMethods();
        return methods;
    }

    /**
     * Returns a list containing MethodNode objects for
     * each abstract method in the class represented by 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产又黄又大久久| 欧美日韩亚洲国产综合| 色综合久久六月婷婷中文字幕| 欧美日韩一区二区三区在线看 | 2023国产一二三区日本精品2022| 中文字幕不卡在线观看| 午夜不卡av免费| 成人精品高清在线| 欧美一级视频精品观看| 亚洲裸体在线观看| 国产美女精品在线| 欧美日韩精品二区第二页| 国产精品天美传媒| 国产一区二区视频在线| 欧美人妖巨大在线| 亚洲精品欧美二区三区中文字幕| 国产裸体歌舞团一区二区| 欧美三级资源在线| 国产性天天综合网| 美国欧美日韩国产在线播放| 91免费观看视频在线| 国产亚洲精品bt天堂精选| 日本aⅴ亚洲精品中文乱码| 91国模大尺度私拍在线视频| 国产精品国产三级国产专播品爱网| 奇米一区二区三区| 91麻豆精品国产综合久久久久久| 亚洲女人****多毛耸耸8| 成人国产精品免费观看视频| 精品国产乱码久久久久久久久| 亚洲va在线va天堂| 欧美日韩视频专区在线播放| 一区二区免费在线播放| 99re这里只有精品首页| 国产精品久久久久久久久快鸭 | 欧美一级在线观看| 欧美aⅴ一区二区三区视频| 欧美无砖砖区免费| 性感美女久久精品| 欧美日韩国产一区| 丝瓜av网站精品一区二区| 欧美三级韩国三级日本三斤| 亚洲大尺度视频在线观看| 欧美在线播放高清精品| 亚洲chinese男男1069| 欧美少妇xxx| 首页国产丝袜综合| 日韩一区二区三区视频在线观看| 日韩av不卡在线观看| 91精品国产欧美一区二区| 另类人妖一区二区av| 久久久噜噜噜久久中文字幕色伊伊| 激情综合五月婷婷| 欧美高清在线精品一区| 91丝袜呻吟高潮美腿白嫩在线观看| 国产精品久久免费看| 色婷婷久久久综合中文字幕| 亚洲午夜精品网| 日韩欧美中文字幕制服| 国产高清精品久久久久| 国产精品国产三级国产aⅴ原创 | 五月天久久比比资源色| 欧美一区二区三区在线看| 看电视剧不卡顿的网站| 国产精品嫩草影院com| 色老综合老女人久久久| 日韩精品一级二级| 欧美激情综合在线| 欧美性xxxxxx少妇| 国产一区二区日韩精品| 亚洲三级在线免费观看| 欧美一区永久视频免费观看| 国产激情91久久精品导航| 亚洲乱码中文字幕| 日韩色在线观看| 99精品黄色片免费大全| 日本中文字幕不卡| ...xxx性欧美| 日韩免费观看2025年上映的电影| 成人av电影在线| 日本不卡在线视频| 亚洲女人小视频在线观看| 日韩写真欧美这视频| 91丨九色丨蝌蚪富婆spa| 免费在线视频一区| 亚洲卡通欧美制服中文| 精品免费国产二区三区| 在线观看日韩av先锋影音电影院| 老汉av免费一区二区三区| 亚洲美女少妇撒尿| 欧美精品一区二区三区高清aⅴ | 国产69精品久久99不卡| 亚洲成av人**亚洲成av**| 国产精品欧美一区二区三区| 欧美日韩第一区日日骚| 9人人澡人人爽人人精品| 久久99国产精品久久| 午夜精品福利一区二区三区蜜桃| 国产精品日产欧美久久久久| 精品少妇一区二区三区日产乱码 | 欧美成人福利视频| 欧美日韩一区三区| 99riav久久精品riav| 国产不卡视频在线播放| 久久精品国产999大香线蕉| 亚洲精品日韩综合观看成人91| 久久久精品国产99久久精品芒果| 欧美精品乱码久久久久久| 在线观看免费亚洲| 91浏览器打开| 99久久久国产精品| 国产成人av电影在线| 久久精品国产网站| 蜜桃av噜噜一区| 午夜伦欧美伦电影理论片| 亚洲综合色区另类av| 看电视剧不卡顿的网站| xnxx国产精品| 日韩精品一区二区在线观看| 日本韩国视频一区二区| 色欧美日韩亚洲| 婷婷中文字幕一区三区| 婷婷一区二区三区| 高清视频一区二区| 欧美日韩国产不卡| 国产精品亲子伦对白| 天天操天天色综合| 成人av电影在线网| 7777精品伊人久久久大香线蕉超级流畅| 久久综合狠狠综合久久综合88| 中文字幕在线观看一区二区| 日韩精品色哟哟| 91尤物视频在线观看| 精品国产一区二区三区久久久蜜月 | 日韩视频在线观看一区二区| 中文字幕免费不卡| 欧美bbbbb| 色婷婷综合久久久中文一区二区| 精品国产一区二区三区av性色 | 中文字幕中文在线不卡住| 免费观看在线综合| 91精彩视频在线| 国产欧美日韩不卡| 久久精品国产精品亚洲精品| 色欧美日韩亚洲| 国产精品少妇自拍| 极品少妇一区二区| 在线不卡一区二区| 一区二区高清在线| 99热99精品| 国产亚洲1区2区3区| 免费的国产精品| 欧美日韩国产高清一区二区三区 | 亚洲嫩草精品久久| 成人一级片在线观看| 日韩久久精品一区| 日韩成人dvd| 欧美性xxxxxx少妇| 一区二区三区精密机械公司| 成人aaaa免费全部观看| 久久精品人人做人人爽97| 美洲天堂一区二卡三卡四卡视频| 欧美日韩在线播放三区| 一区二区三区四区在线免费观看 | 午夜欧美2019年伦理| 91成人免费在线视频| 国产精品二区一区二区aⅴ污介绍| 九九九精品视频| 日韩欧美国产一区二区在线播放 | 欧美高清dvd| 亚洲第一综合色| 欧美色网站导航| 亚洲一本大道在线| 欧美三级一区二区| 五月激情六月综合| 欧美精品一级二级三级| 日日夜夜免费精品| 欧美一区二区福利在线| 蜜桃视频在线观看一区| 日韩精品中文字幕一区二区三区 | 国产精品资源站在线| 久久综合国产精品| 国产1区2区3区精品美女| 国产精品天天看| 色婷婷综合久久久久中文一区二区| 伊人色综合久久天天人手人婷| 色呦呦国产精品| 亚洲国产wwwccc36天堂| 91精品在线观看入口| 麻豆91免费观看| 久久先锋资源网| www.在线欧美| 亚洲一区二区在线免费观看视频| 欧美性受xxxx| 日本美女一区二区| 国产欧美日韩卡一| 91蜜桃网址入口| 日产国产高清一区二区三区| 久久综合久久99| 91社区在线播放|