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

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

?? patternpath.java

?? jsr170接口的java實現。是個apache的開源項目。
?? JAVA
字號:
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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.jackrabbit.classloader;import java.util.ArrayList;import java.util.Iterator;import java.util.List;import java.util.StringTokenizer;import javax.jcr.Item;import javax.jcr.Node;import javax.jcr.NodeIterator;import javax.jcr.PropertyIterator;import javax.jcr.RepositoryException;import javax.jcr.Session;import org.apache.jackrabbit.util.ChildrenCollectorFilter;import org.slf4j.Logger;import org.slf4j.LoggerFactory;/** * The <code>PatternPath</code> implements a list of repository item path * patterns providing an iterator on the expanded paths. The list of patterns is * immutably configured from an array of strings. * <p> * While the original list of path patterns may be retrieved for informational * purposes by calling the {@link #getPath()} method, the primary contents of * instances of this class are the expanded paths accessible by calling the * {@link #getExpandedPaths()} method. * <p> * Please note that though this list is immutable there is intentionally no * guarantee that all invocations of the {@link #getExpandedPaths} method * return the same contents as the patterns contained in the list may expand to * different paths for each invocation of that method. * <p> * Each entry in the pattern list is a path whose segments conform to the * pattern syntax defined for the <code>Node.getNodes(String)</code> method. * The pattern may be a full name or a partial name with one or more wildcard * characters ("*"), or a disjunction (using the "|" character to represent * logical <i>OR</i>) of these. For example, * <blockquote><code>"jcr:*|foo:bar"</code></blockquote> * would match <code>"foo:bar"</code>, but also <code>"jcr:whatever"</code>. * <p> * The EBNF for pattern is: * <pre> * namePattern ::= disjunct {'|' disjunct} * disjunct ::= name [':' name] * name ::= '*' | *          ['*'] fragment {'*' fragment}['*'] * fragment ::= char {char} * char ::= nonspace | ' ' * nonspace ::= (* Any Unicode character except: *               '/', ':', '[', ']', '*', *               ''', '"', '|' or any whitespace *               character *) * </pre> * * @author Felix Meschberger *//* package */ class PatternPath {    /** default logger */    private static final Logger log =        LoggerFactory.getLogger(PatternPath.class);    /** The session to access the repository */    private final Session session;    /** The list of path patterns */    private final String[] patterns;    /**     * Creates a <code>PatternPath</code> containing the elements of the     * string array. Each entry in the array which is either empty or     * <code>null</code> is ignored and not added to the list. If the array     * is empty or only contains empty or <code>null</code> elements, the     * resulting list will consequently be empty.     *     * @param session The session to access the Repository to expand the paths     *      and to register as an event listener.     * @param pathPatterns The array of path patterns to add.     *     * @throws NullPointerException if the <code>pathPatterns</code> array or     *      the <code>session</code> is <code>null</code>.     */    /* package */ PatternPath(Session session, String[] pathPatterns) {        // check session        if (session == null) {            throw new NullPointerException("session");        }        // prepare the pattern list, excluding null/empty entries        List patternList = new ArrayList();        for (int i=0; i < pathPatterns.length; i++) {            addChecked(patternList, pathPatterns[i]);        }        patterns =            (String[]) patternList.toArray(new String[patternList.size()]);        this.session = session;    }    /**     * Returns the session from which this instance has been constructed.     */    /* package */ Session getSession() {        return session;    }    /**     * Returns a copy of the list of path patterns from which this instance has     * been constructed.     */    /* package */  String[] getPath() {        return (String[]) patterns.clone();    }    /**     * Returns the list of expanded paths matching the list of patterns. This     * list is guaranteed to only return existing items.     * <p>     * Each invocation of this method expands the pattern anew and returns a     * new list instance.     *     * @return The list of paths matching the patterns. If the pattern list is     *      empty or if no real paths match for any entry in the list, the     *      returned list is empty.     *     * @throws RepositoryException if an error occurrs expanding the path     *      pattern list.     */    /* package */ List getExpandedPaths() throws RepositoryException {        List result = new ArrayList(patterns.length);        Node root = session.getRootNode();        for (int i=0; i < patterns.length; i++) {            String entry = patterns[i];            if (entry.indexOf('*') >= 0 || entry.indexOf('|') >= 0) {                scan(root, entry, result);            } else {                // add path without pattern characters without further                // checking. This allows adding paths which do not exist yet.                result.add(entry);            }        }        return result;    }    //---------- Object overwrite ----------------------------------------------    /**     * Returns <code>true</code> if this object equals the other object. This     * implementation only returns true if the other object is the same as this     * object.     * <p>     * The difference to the base class implementation is, that we only accept     * equality if the other object is the same than this object. This is     * actually the same implementation as the original <code>Object.equals</code>     * implementation.     *     * @param o The other object to compare to.     *     * @return <code>true</code> if the other object is the same as this.     */    public boolean equals(Object o) {        return o == this;    }    /**     * Returns a hashcode for this instance. This is currently the hash code     * returned by the parent implementation. While it does not violate the     * contract to not change the <code>hashCode()</code> implementation but     * to change the implementation of the {@link #equals} method, I think this     * is ok, because our implementation of the {@link #equals} method is just     * more specific than the base class implementation, which also allows     * the other object to be a list with the same contents.     *     * @return The hash code returned by the base class implementation.     */    public int hashCode() {        return super.hashCode();    }    /**     * Returns a string representation of this instance. This is actually the     * result of the string representation of the List, this actually is,     * prefixed with the name of this class.     *     * @return The string representation of this instance.     */    public String toString() {        StringBuffer buf = new StringBuffer("PatternPath: [");        for (int i=0; i < patterns.length; i++) {            if (i != 0) buf.append(", ");            buf.append(patterns[i]);        }        buf.append("]");        return buf.toString();    }    //---------- internal ------------------------------------------------------    /**     * Adds the string to the list of patterns, if neither empty nor     * <code>null</code>. If the string has one or more trailing slashes     * (<em>/</em>) they are removed before adding the string.     */    private void addChecked(List patternList, String pattern) {        if (pattern == null || pattern.length() == 0) {            log.debug("addChecked: Not adding null/empty pattern");        } else {            // remove all trailing slashes            while (pattern.endsWith("/") && pattern.length() > 1) {                pattern = pattern.substring(0, pattern.length()-1);            }            log.debug("addChecked: Adding {}");            patternList.add(pattern);        }    }    //---------- Path expansion -----------------------------------------------    /**     * Finds the paths of all nodes and properties matching the pattern below     * the <code>root</code> node.     *     * @param root The root node of the subtree to match against the path     *      pattern.     * @param pathPattern The path pattern to use to find matching nodes.     * @param gather The list into which the paths of matching child items     *      are added.     */    private static void scan(Node root, String pathPattern, List gather)            throws RepositoryException {        // initial list of candidates is the root node        List candidates = new ArrayList();        candidates.add(root);        StringTokenizer patterns = new StringTokenizer(pathPattern, "/");        boolean moreTokens = patterns.hasMoreTokens();        while (moreTokens) {            String pattern = patterns.nextToken();            moreTokens = patterns.hasMoreTokens();            // new candidates are the children of the current candidates list            // matching the current pattern            List newCandidates = new ArrayList();            for (Iterator ci=candidates.iterator(); ci.hasNext(); ) {                Node current = (Node) ci.next();                for (NodeIterator ni=current.getNodes(pattern); ni.hasNext(); ) {                    newCandidates.add(ni.nextNode());                }                // if pattern is the last, also consider properties                if (!moreTokens) {                    PropertyIterator pi = current.getProperties(pattern);                    while (pi.hasNext()) {                        newCandidates.add(pi.nextProperty());                    }                }            }            // drop old candidates and use new for next step            candidates.clear();            candidates = newCandidates;        }        // add paths of the candidates to the gather list        for (Iterator ci=candidates.iterator(); ci.hasNext(); ) {            Item current = (Item) ci.next();            gather.add(current.getPath());        }    }    //---------- matching support ---------------------------------------------    /**     * Applies the list of path patterns to the given path returning     * <code>true</code> if it matches, <code>false</code> otherwise.     * <p>     * <b><em>This method is package protected for testing purposes. This     * method is not intended to be used by clients. Its specification or     * implementation may change without notice.</em></b>     *     * @param path The path to match with the pattern list.     *     * @return <code>true</code> if the path matches any of the patterns.     */    /* package */ boolean matchPath(String path) {        StringTokenizer exploded = new StringTokenizer(path, "/");        OUTER_LOOP:        for (int i=0; i < patterns.length; i++) {            StringTokenizer exEntry = new StringTokenizer(patterns[i], "/");            // ignore if the number of path elements to not match            if (exploded.countTokens() != exEntry.countTokens()) {                continue;            }            while (exploded.hasMoreTokens()) {                if (!ChildrenCollectorFilter.matches(exploded.nextToken(),                        exEntry.nextToken())) {                    continue OUTER_LOOP;                }            }            // if I get here, the path matches entry[i]            return true;        }        // if we run out, no match has been found        return false;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲激情图片小说视频| 欧美日韩一区三区四区| 久久一区二区三区国产精品| 日产精品久久久久久久性色| 欧美一区二区视频网站| 麻豆一区二区三区| 精品免费一区二区三区| 国产精品自拍在线| 亚洲国产精品二十页| 成人avav影音| 亚洲国产一二三| 欧美一区二区三区四区久久| 精品一区二区三区久久久| 国产天堂亚洲国产碰碰| 91亚洲国产成人精品一区二三| 亚洲品质自拍视频| 欧美精品九九99久久| 美女性感视频久久| 亚洲国产精品av| 欧洲视频一区二区| 精品视频全国免费看| 亚洲国产aⅴ成人精品无吗| 欧美肥胖老妇做爰| 国产一区二区三区日韩 | 精品亚洲porn| 中文字幕乱码亚洲精品一区| 在线免费观看一区| 久久精品国产秦先生| 国产精品天天看| 欧美婷婷六月丁香综合色| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产亚洲女人久久久久毛片| 色偷偷久久人人79超碰人人澡 | 国产婷婷色一区二区三区在线| 99久久精品国产一区| 视频一区二区国产| 久久久影视传媒| 欧洲另类一二三四区| 国产乱码精品一区二区三| 一区二区在线看| 久久久国产精华| 欧美在线观看视频在线| 国产精品综合一区二区| 亚洲第一激情av| 国产精品毛片高清在线完整版| 欧美日本高清视频在线观看| 国产91精品入口| 青娱乐精品在线视频| 国产精品免费aⅴ片在线观看| 欧美一区二区三区日韩视频| 99久久免费国产| 久久精品国产成人一区二区三区| 一区二区三区在线免费播放| 国产人成亚洲第一网站在线播放| 欧美日韩电影在线| 91免费国产视频网站| 国产一区中文字幕| 日本成人在线网站| 亚洲一区二区欧美| 亚洲日本va在线观看| 久久久久97国产精华液好用吗| 欧美日韩国产电影| 欧美视频在线播放| 91网站最新地址| 成人精品视频一区二区三区尤物| 麻豆精品在线视频| 日韩经典一区二区| 亚洲6080在线| 亚洲韩国精品一区| 亚洲精品ww久久久久久p站| 国产精品初高中害羞小美女文| 2024国产精品| 欧美精品一区二区三区视频| 91精品婷婷国产综合久久性色| 在线观看亚洲一区| 91国产免费看| 91国产免费观看| 色婷婷综合激情| 色欧美88888久久久久久影院| 不卡一区二区中文字幕| 不卡av在线网| av一区二区三区四区| 99久久久久免费精品国产| 波多野结衣亚洲一区| 成人黄色免费短视频| 成人激情开心网| av在线不卡免费看| 91美女视频网站| 欧美亚洲一区二区在线观看| 欧美中文字幕一区二区三区| 欧美亚洲综合在线| 欧美精品少妇一区二区三区| 制服丝袜国产精品| 欧美本精品男人aⅴ天堂| 精品国产乱码久久久久久久久| 精品国产欧美一区二区| 国产亚洲欧美一区在线观看| 国产午夜一区二区三区| 国产精品白丝在线| 亚洲综合在线视频| 日韩av不卡在线观看| 黑人精品欧美一区二区蜜桃| 国产成人精品亚洲午夜麻豆| 成人国产一区二区三区精品| 色婷婷综合在线| 欧美高清视频不卡网| 精品欧美黑人一区二区三区| 国产精品久久久久婷婷二区次| 亚洲欧美偷拍三级| 日本sm残虐另类| 国产成人在线观看免费网站| 91网上在线视频| 欧美一区二区高清| 国产欧美精品一区二区三区四区| 亚洲欧美另类图片小说| 午夜国产不卡在线观看视频| 国产一区不卡精品| 色综合中文字幕| 欧美一级在线视频| 国产精品三级视频| 天天免费综合色| 粉嫩高潮美女一区二区三区| 欧美特级限制片免费在线观看| 精品久久久久一区二区国产| 国产精品久久久久影视| 日韩av高清在线观看| 成人免费看黄yyy456| 欧美美女一区二区三区| 国产欧美一区二区三区沐欲| 午夜精品国产更新| 成人黄色a**站在线观看| 51精品国自产在线| 自拍视频在线观看一区二区| 五月综合激情网| 99久久综合色| 日韩精品一区二区三区三区免费| 最近日韩中文字幕| 黑人精品欧美一区二区蜜桃| 欧美日韩国产在线播放网站| 亚洲国产精品激情在线观看 | 一本久久a久久精品亚洲 | 欧美卡1卡2卡| 中文字幕在线视频一区| 久久91精品久久久久久秒播| 91福利精品视频| 欧美国产精品专区| 久久99在线观看| 欧美日韩国产影片| 亚洲日本一区二区| 成人黄色电影在线| 久久人人爽人人爽| 麻豆精品一二三| 欧美情侣在线播放| 亚洲精品乱码久久久久久久久| 国产福利一区二区三区视频在线| 91精品国产综合久久香蕉的特点| 一区二区三区四区五区视频在线观看| 国产激情偷乱视频一区二区三区| 欧美一区二区在线免费播放 | 色综合天天综合在线视频| 欧美精品一区二| 裸体健美xxxx欧美裸体表演| 欧美日本韩国一区二区三区视频 | 亚洲国产成人精品视频| 不卡一区二区三区四区| 久久久久综合网| 亚洲一区二区免费视频| 风间由美性色一区二区三区| 欧美v日韩v国产v| 奇米影视一区二区三区| 欧美日韩日本视频| 亚洲综合无码一区二区| 在线看一区二区| 亚洲美腿欧美偷拍| 日本韩国精品在线| 亚洲在线中文字幕| 色国产综合视频| 亚洲国产精品久久艾草纯爱| 欧美色爱综合网| 免费人成网站在线观看欧美高清| 欧美精品在线视频| 日韩av中文字幕一区二区三区 | 福利一区二区在线| 国产精品热久久久久夜色精品三区 | 麻豆国产精品官网| 日韩一级二级三级| 国产一区二区在线视频| 国产亚洲综合在线| 99精品视频在线播放观看| 自拍偷拍国产亚洲| 欧美日韩一区二区在线观看视频| 亚洲午夜精品网| 日韩美一区二区三区| 国产成人在线影院| 国产精品成人一区二区艾草 | 色噜噜夜夜夜综合网| 一区二区欧美视频| 91精品国产91久久久久久最新毛片| 免费成人在线网站| 国产三级精品视频|