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

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

?? basepsmldocument.java

?? jetspeed源代碼
?? JAVA
字號:
/*
 * Copyright 2000-2001,2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jetspeed.om.profile;

import org.apache.jetspeed.om.profile.Portlets;
import org.apache.jetspeed.om.profile.Entry;
import java.util.Iterator;

/**
 * This class represents a loaded PSML document in memory, providing
 * all facilities for finding and updating specific parts of the 
 * document.
 *
 * @author <a href="mailto:raphael@apache.org">Rapha雔 Luta</a>
 * @version $Id: BasePSMLDocument.java,v 1.9 2004/02/23 03:05:01 jford Exp $
 */
public class BasePSMLDocument implements PSMLDocument
{
    /**
     * The name of this PSML document, will be typically the URL of the file
     * for file-based implementations
     */
    private String name = null;

    /**
     * The PortletSet descriptions that make up this document
     */
    private Portlets portlets = null;

    /**
     * Construct a new empty PSMLDocument
     */
    public BasePSMLDocument()
    {
        // empty constructor
    }

    /**
     * Construct a new named PSMLDocument associated with the specified
     * PSML portlet set description
     *
     * @param name the name of this document
     * @param portlets the PSML memory structure
     */
    public BasePSMLDocument( String name, Portlets portlets )
    {
        this.name = name;
        this.portlets = portlets;
    }
    
    /**
     * Return the name of this document
     */
    public final String getName()
    {
        return this.name;
    }
        
    /**
     * Sets a new name for this document
     * 
     * @param name the new document name
     */
    public final void setName(String name)
    {
        this.name = name;
    }

    /**
     * Return ths portlet set PSML description of this document
     *
     * @return a PSML object model hierarchy, or null if none is 
     * defined for this document
     */
    public final Portlets getPortlets()
    {
        return this.portlets;
    }

    /**
     * Sets a new PSML object model for this document
     * 
     * @param portlets the PSML object model
     */
    public final void setPortlets(Portlets portlets)
    {
        this.portlets = portlets;
    }

    /** Returns the first entry in the current PSML resource corresponding 
     *  to the given portlet name
     * 
     *  @param name the portlet name to seek
     *  @return the found entry description or null
     */
    public Entry getEntry(String name)
    {
        return getEntry(this.portlets, name);
    }

    /** Returns the first entry in the current PSML resource corresponding 
     *  to the given entry id
     * 
     *  @param entryId the portlet's entry id to seek
     *  @return the found entry description or null
     */
    public Entry getEntryById(String entryId)
    {
        return getEntryById(this.portlets, entryId);
    }

    /** Returns the first portlets element in the current PSML resource corresponding 
     *  to the given name
     * 
     *  @param name the portlets name to seek
     *  @return the found portlets description or null
     */
    public Portlets getPortlets(String name)
    {        
        Portlets p = getPortlets(this.portlets, name);
        
        if (p == null)
        {
            //maybe name is a position...
            try
            {
                p = getPortlets(Integer.parseInt(name));
            }
            catch (NumberFormatException e)
            {
                // this will happen if name is not parseable, ignore
            }
        }
        
        return p;
    }

    /** Returns the first portlets element in the current PSML resource corresponding 
     *  to the given id
     * 
     *  @param name the portlets id to seek
     *  @return the found portlets description or null
     */
    public Portlets getPortletsById(String portletId)
    {        
        Portlets p = getPortletsById(this.portlets, portletId);
        return p;
    }

    /** Returns the first portlets element in the current PSML resource 
     *  found at the specified position. The position is computed using
     *  a left-most tree traversal algorithm of the existing portlets (thus
     *  not counting other entry objects)
     * 
     *  @param position the sought position
     *  @return the found portlets object or null if we did not find such an
     *  object
     */
    public Portlets getPortlets(int position)
    {
        return getPortlets(this.portlets, position, 0);
    }

    /** Returns the first entry in the specified PSML resource corresponding 
     *  to the given portlet name
     * 
     *  @param portlets the PSML description to look into
     *  @param name the portlet name to seek
     *  @return the found entry description or null
     */
    public static Entry getEntry(Portlets portlets, String name)
    {
        Entry entry = null;

        for (Iterator it1 = portlets.getEntriesIterator(); it1.hasNext(); )
        {
            entry = (Entry) it1.next();
            if (entry.getParent().equals (name))
                 return (entry);
        }

        entry = null;

        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();

            entry = getEntry(p, name);

            if (entry != null)
                 break;
        }

        return (entry);
    }

    /** Returns the first entry in the specified PSML resource corresponding 
     *  to the given portlet Id
     * 
     *  @param portlets the PSML description to look into
     *  @param entryId the portlet's entry id to seek
     *  @return the found entry description or null
     */
    public static Entry getEntryById(Portlets portlets, String entryId)
    {
        Entry entry = null;

        for (Iterator it1 = portlets.getEntriesIterator(); it1.hasNext(); )
        {
            entry = (Entry) it1.next();
            if ((entry.getId()!=null) && entry.getId().equals (entryId))
                 return (entry);
        }

        entry = null;

        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();

            entry = getEntryById(p, entryId);

            if (entry != null)
                 break;
        }

        return (entry);
    }

    /** Returns the first portlets element in the specified PSML resource corresponding 
     *  to the given Id
     * 
     *  @param portlets the PSML description to look into
     *  @param portletId the portlet's id to seek
     *  @return the found portlets description or null
     */
    public static Portlets getPortletsById(Portlets portlets, String portletId)
    {
        Portlets entry = portlets;
        
        if ( (entry.getId()!=null) && entry.getId().equals(portletId) )
        {
            return entry;
        }

        entry = null;
        
        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();

            entry = getPortletsById(p, portletId);

            if (entry != null) break;
        }

        return (entry);
    }

    /** Returns the first portlets element in the specified PSML resource corresponding 
     *  to the given name
     * 
     *  @param portlets the PSML description to look into
     *  @param name the portlets name to seek
     *  @return the found portlets description or null
     */
    public static Portlets getPortlets(Portlets portlets, String name)
    {
        Portlets entry = portlets;
        
        if ( (entry.getName()!=null) && entry.getName().equals(name) )
        {
            return entry;
        }

        entry = null;
        
        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();

            entry = getPortlets(p, name);

            if (entry != null) break;
        }

        return (entry);
    }
    /** Returns the first portlets element in the specified PSML resource 
     *  in the given position
     * 
     *  @param portlets the PSML description to look into
     *  @param position the position to look for
     *  @param count the numbering for the portlets passed as parameter
     *  @return the found portlets description or null
     */
    public static Portlets getPortlets(Portlets portlets, int position, int count)
    {
        // sanity check, we never look after the sought position
        if (position < count)
        {
            return null;
        }
        
        // the base portlets is the one we're looking for...
        if (position == count)
        {
            return portlets;
        }

        // we need to recurse in the children
        Portlets result = null;
        
        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();
            count++;
            result = getPortlets(p, position, count);

            if (result != null) break;
        }

        return result;
    }
    /**
     * Remove the Entry in the specified PSML resource corresponding 
     * to the given portlet Id
     * 
     * @param entryId the portlet's entry id to seek
     */
    public boolean removeEntryById(String entryId)
    {        
        return removeEntryById(this.portlets, entryId);
    }

    /**
     * Remove the Entry in the specified PSML resource corresponding 
     * to the given portlet Id
     * 
     * @param portlets the PSML description to look into
     * @param entryId the portlet's entry id to seek
     */
    public static boolean removeEntryById(Portlets portlets, String entryId)
    {
        for (int i=0; i < portlets.getEntryCount(); i++)
        {
            if ( entryId.equals(portlets.getEntry(i).getId()) )
            {
                portlets.removeEntry(i);
                return true;
            }
        }

        for (Iterator it2 = portlets.getPortletsIterator(); it2.hasNext(); )
        {
            Portlets p = (Portlets) it2.next();

            if (removeEntryById(p, entryId) == true)
                return true;
        }

        return false;
    }

    /**
     * Create a clone of this object
     */
    public Object clone()
        throws java.lang.CloneNotSupportedException
    {
        Object cloned = super.clone();
        
        // clone the portlets
        ((BasePSMLDocument)cloned).portlets = ((this.portlets == null) ? null : (Portlets) this.portlets.clone());
        
        return cloned;
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
51久久夜色精品国产麻豆| 久久影院电视剧免费观看| 久久99精品久久久久久国产越南 | 午夜精品福利一区二区蜜股av| 337p日本欧洲亚洲大胆色噜噜| 色综合婷婷久久| 国产精品一级片在线观看| 亚洲成人手机在线| 国产精品国产三级国产普通话三级| 欧美狂野另类xxxxoooo| 一本一本大道香蕉久在线精品| 国产精品综合一区二区三区| 丝袜国产日韩另类美女| 亚洲欧美国产77777| 日本一区二区电影| 国产精品国产三级国产普通话99 | 99精品桃花视频在线观看| 久久国产成人午夜av影院| 亚洲午夜久久久| 亚洲美女视频一区| 亚洲日本丝袜连裤袜办公室| 久久久久久一二三区| 日韩欧美电影在线| 日韩一区二区精品葵司在线 | 欧美日韩久久久久久| 91丨porny丨中文| 99视频一区二区三区| 成人国产精品免费网站| 国产激情视频一区二区三区欧美 | 欧美日韩一区高清| 色婷婷亚洲精品| 色婷婷狠狠综合| 色综合久久久久综合体| 91在线观看一区二区| jizzjizzjizz欧美| aa级大片欧美| 91美女片黄在线观看| 99国产精品99久久久久久| 成人激情午夜影院| 成人h动漫精品一区二区 | 日韩欧美成人一区| 精品国产一区二区三区久久影院| 日韩欧美国产一区二区在线播放| 日韩欧美国产综合在线一区二区三区| 亚洲欧美在线高清| 国产精品女同互慰在线看| 国产精品久久午夜| 亚洲日本va午夜在线电影| 亚洲免费在线观看| 亚洲国产精品尤物yw在线观看| 婷婷国产v国产偷v亚洲高清| 麻豆国产91在线播放| 国内精品免费**视频| 不卡一区二区在线| 91久久精品网| 日韩欧美成人一区| 欧美激情一区二区三区四区| 亚洲三级在线播放| 日韩制服丝袜av| 激情综合色综合久久综合| 国产v日产∨综合v精品视频| eeuss鲁片一区二区三区| 在线看日本不卡| 欧美刺激午夜性久久久久久久| 久久久亚洲国产美女国产盗摄| 亚洲欧美在线视频| 日韩精品亚洲一区| 成人精品鲁一区一区二区| 色一情一伦一子一伦一区| 69堂成人精品免费视频| 国产日韩欧美高清| 亚洲一区日韩精品中文字幕| 久久99国产精品麻豆| 成人av小说网| 欧美美女一区二区在线观看| 国产亚洲制服色| 一区二区三区电影在线播| 老司机精品视频线观看86 | 日韩一区二区三| 国产精品午夜免费| 石原莉奈在线亚洲三区| 成人一级片在线观看| 欧美日韩免费观看一区三区| 久久综合色婷婷| 亚洲午夜免费视频| 国产精品一区二区在线观看不卡| 色综合久久九月婷婷色综合| 欧美xxxxxxxx| 亚洲精品老司机| 精品亚洲成a人在线观看| 欧美在线看片a免费观看| 国产调教视频一区| 奇米色一区二区| 在线日韩av片| 午夜日韩在线观看| aaa国产一区| 久久看人人爽人人| 日韩中文字幕麻豆| 色综合久久久久综合体| 欧美国产日本韩| 理论电影国产精品| 欧美丰满一区二区免费视频| 中文字幕中文字幕中文字幕亚洲无线| 日韩精品国产精品| 欧美午夜免费电影| 国产精品成人午夜| 国产精品一区二区视频| 日韩亚洲欧美综合| 亚洲五月六月丁香激情| 99在线热播精品免费| 久久久久久99久久久精品网站| 婷婷综合在线观看| 欧美日韩一二区| 亚洲手机成人高清视频| 大尺度一区二区| 国产亚洲精品资源在线26u| 美女视频黄频大全不卡视频在线播放 | 日本一道高清亚洲日美韩| 91久久精品国产91性色tv| √…a在线天堂一区| 国产成人免费视频| 精品国产露脸精彩对白| 美女诱惑一区二区| 91精品国产aⅴ一区二区| 午夜精品久久久久| 欧美日本在线观看| 亚洲电影激情视频网站| 欧美日韩电影在线| 日韩国产精品久久久久久亚洲| 亚洲成a人片在线观看中文| 国产成人av福利| 91精品国产91热久久久做人人| 一区二区欧美视频| 日本福利一区二区| 亚洲精品国久久99热| 99riav久久精品riav| 成人欧美一区二区三区黑人麻豆| 成人高清视频在线| 国产精品久久久久国产精品日日| 成人激情小说乱人伦| 中文字幕中文在线不卡住| 色丁香久综合在线久综合在线观看| 亚洲丝袜精品丝袜在线| 色国产精品一区在线观看| 一区二区在线看| 7777精品伊人久久久大香线蕉最新版| 午夜a成v人精品| 欧美大肚乱孕交hd孕妇| 国产高清久久久| 亚洲美腿欧美偷拍| 欧美日韩国产电影| 久久99久国产精品黄毛片色诱| 精品久久人人做人人爱| 成人综合在线视频| 一个色在线综合| 91精品国产免费久久综合| 精品一二线国产| 国产精品美女久久久久久久| 色香色香欲天天天影视综合网| 亚洲精品午夜久久久| 欧美日韩在线播放| 激情欧美日韩一区二区| 亚洲欧洲日韩av| 欧美日本一道本| 国产精品亚洲成人| 亚洲最新视频在线观看| 欧美一级欧美一级在线播放| 国产很黄免费观看久久| 一区二区三区精品在线观看| 日韩午夜三级在线| av一区二区三区在线| 日韩av网站在线观看| 国产日韩欧美a| 欧美三级日本三级少妇99| 韩国女主播一区| 亚洲精品成人天堂一二三| 欧美r级电影在线观看| 91视频.com| 韩国欧美一区二区| 亚洲影视在线播放| 久久久电影一区二区三区| 91成人免费网站| 国产一区二区h| 亚洲高清免费在线| 中文字幕不卡在线播放| 欧美日韩午夜在线视频| 不卡一二三区首页| 久久99精品久久久久久国产越南| 亚洲欧美福利一区二区| 久久久久久久久久久久久久久99 | 美腿丝袜亚洲三区| 亚洲欧美偷拍另类a∨色屁股| 欧美成人精品福利| 欧洲精品一区二区三区在线观看| 久久99国产精品久久99| 亚洲大型综合色站| 综合色中文字幕| 久久久综合视频| 欧美一区二区三区在线视频| 色欲综合视频天天天|