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

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

?? statemachinefactory.java

?? mina是以Java實現的一個開源的網絡程序框架
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* *  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.mina.statemachine;import java.lang.annotation.Annotation;import java.lang.reflect.Field;import java.lang.reflect.Method;import java.lang.reflect.Modifier;import java.util.ArrayList;import java.util.Arrays;import java.util.Comparator;import java.util.HashMap;import java.util.LinkedHashMap;import java.util.LinkedList;import java.util.List;import java.util.Map;import org.apache.mina.statemachine.annotation.Transition;import org.apache.mina.statemachine.annotation.TransitionAnnotation;import org.apache.mina.statemachine.annotation.Transitions;import org.apache.mina.statemachine.event.Event;import org.apache.mina.statemachine.transition.MethodTransition;/** * Creates {@link StateMachine}s by reading {@link org.apache.mina.statemachine.annotation.State}, * {@link Transition} and {@link Transitions} (or equivalent) annotations from one or more arbitrary  * objects. *  * * @author The Apache MINA Project (dev@mina.apache.org) * @version $Rev: 592479 $, $Date: 2007-11-06 17:26:11 +0100 (Tue, 06 Nov 2007) $ */public class StateMachineFactory {    private final Class<? extends Annotation> transitionAnnotation;    private final Class<? extends Annotation> transitionsAnnotation;    protected StateMachineFactory(Class<? extends Annotation> transitionAnnotation,                 Class<? extends Annotation> transitionsAnnotation) {        this.transitionAnnotation = transitionAnnotation;        this.transitionsAnnotation = transitionsAnnotation;    }        /**     * Returns a new {@link StateMachineFactory} instance which creates      * {@link StateMachine}s by reading the specified {@link Transition}     * equivalent annotation.     *      * @param transitionAnnotation the {@link Transition} equivalent annotation.     * @return the {@link StateMachineFactory}.     */    public static StateMachineFactory getInstance(Class<? extends Annotation> transitionAnnotation) {        TransitionAnnotation a = transitionAnnotation.getAnnotation(TransitionAnnotation.class);        if (a == null) {            throw new IllegalArgumentException("The annotation class "                     + transitionAnnotation + " has not been annotated with the "                     + TransitionAnnotation.class.getName() + " annotation");        }        return new StateMachineFactory(transitionAnnotation, a.value());    }        /**     * Creates a new {@link StateMachine} from the specified handler object and     * using a start state with id <code>start</code>.     *      * @param handler the object containing the annotations describing the      *        state machine.     * @return the {@link StateMachine} object.     */    public StateMachine create(Object handler) {        return create(handler, new Object[0]);    }    /**     * Creates a new {@link StateMachine} from the specified handler object and     * using the {@link State} with the specified id as start state.     *      * @param start the id of the start {@link State} to use.     * @param handler the object containing the annotations describing the      *        state machine.     * @return the {@link StateMachine} object.     */    public StateMachine create(String start, Object handler) {        return create(start, handler, new Object[0]);    }    /**     * Creates a new {@link StateMachine} from the specified handler objects and     * using a start state with id <code>start</code>.     *      * @param handler the first object containing the annotations describing the      *        state machine.     * @param handlers zero or more additional objects containing the      *        annotations describing the state machine.     * @return the {@link StateMachine} object.     */    public StateMachine create(Object handler, Object... handlers) {        return create("start", handler, handlers);    }        /**     * Creates a new {@link StateMachine} from the specified handler objects and     * using the {@link State} with the specified id as start state.     *      * @param start the id of the start {@link State} to use.     * @param handler the first object containing the annotations describing the      *        state machine.     * @param handlers zero or more additional objects containing the      *        annotations describing the state machine.     * @return the {@link StateMachine} object.     */    public StateMachine create(String start, Object handler, Object... handlers) {                Map<String, State> states = new HashMap<String, State>();        List<Object> handlersList = new ArrayList<Object>(1 + handlers.length);        handlersList.add(handler);        handlersList.addAll(Arrays.asList(handlers));                LinkedList<Field> fields = new LinkedList<Field>();        for (Object h : handlersList) {            fields.addAll(getFields(h instanceof Class ? (Class<?>) h : h.getClass()));        }        for (State state : createStates(fields)) {            states.put(state.getId(), state);        }        if (!states.containsKey(start)) {            throw new StateMachineCreationException("Start state '" + start + "' not found.");        }        setupTransitions(transitionAnnotation, transitionsAnnotation, states, handlersList);        return new StateMachine(states.values(), start);    }    private static void setupTransitions(Class<? extends Annotation> transitionAnnotation,             Class<? extends Annotation> transitionsAnnotation, Map<String, State> states, List<Object> handlers) {        for (Object handler : handlers) {            setupTransitions(transitionAnnotation, transitionsAnnotation, states, handler);        }    }        private static void setupTransitions(Class<? extends Annotation> transitionAnnotation,             Class<? extends Annotation> transitionsAnnotation, Map<String, State> states, Object handler) {                Method[] methods = handler.getClass().getDeclaredMethods();        Arrays.sort(methods, new Comparator<Method>() {            public int compare(Method m1, Method m2) {                return m1.toString().compareTo(m2.toString());            }        });                for (Method m : methods) {            List<TransitionWrapper> transitionAnnotations = new ArrayList<TransitionWrapper>();            if (m.isAnnotationPresent(transitionAnnotation)) {                transitionAnnotations.add(new TransitionWrapper(transitionAnnotation, m.getAnnotation(transitionAnnotation)));            }            if (m.isAnnotationPresent(transitionsAnnotation)) {                transitionAnnotations.addAll(Arrays.asList(new TransitionsWrapper(transitionAnnotation,                         transitionsAnnotation, m.getAnnotation(transitionsAnnotation)).value()));            }                        if (transitionAnnotations.isEmpty()) {                continue;            }                        for (TransitionWrapper annotation : transitionAnnotations) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精选在线观看| 久久这里都是精品| 久久成人av少妇免费| 国产成人亚洲精品青草天美| 国产婷婷一区二区| 51午夜精品国产| 国产精品天干天干在观线| 欧美一区二区视频在线观看2022 | 日本韩国欧美一区二区三区| 色成年激情久久综合| 欧美日韩国产成人在线免费| xfplay精品久久| 久久综合狠狠综合久久综合88 | 久久精品夜夜夜夜久久| 欧美日韩高清不卡| 欧美性猛片xxxx免费看久爱| 大胆亚洲人体视频| 亚洲成人一二三| 久久久久综合网| 精品国产乱码久久| 欧美激情一区二区三区全黄| 国产拍揄自揄精品视频麻豆| 国产suv精品一区二区三区| 爽爽淫人综合网网站| 日本欧美一区二区| 国产精品1024| 九九在线精品视频| 一二三四社区欧美黄| 中文字幕乱码日本亚洲一区二区| 欧美一区二区黄色| 国产成人在线观看| 午夜欧美2019年伦理| 国产日韩欧美在线一区| 91精品国产色综合久久久蜜香臀| 成人免费毛片嘿嘿连载视频| 一区二区三区日本| 久久嫩草精品久久久精品一| 欧美日韩国产精选| 日韩午夜电影av| 久久久99精品免费观看不卡| 成人黄色777网| 欧美在线不卡视频| 亚洲欧洲三级电影| 成人免费观看男女羞羞视频| 日韩女优视频免费观看| 亚洲一区二区三区精品在线| 国产精品女上位| 9i看片成人免费高清| 久久久精品tv| 亚洲成年人影院| hitomi一区二区三区精品| 91丨九色丨蝌蚪富婆spa| 精品国产麻豆免费人成网站| 国产精品久久三| 国产精品久久午夜| 久久电影网站中文字幕| 精品一区二区三区影院在线午夜| 北岛玲一区二区三区四区| 欧美一区欧美二区| 亚洲亚洲人成综合网络| 欧美一区二区三区免费在线看| 一区二区三区中文字幕在线观看| 国产人成亚洲第一网站在线播放 | 国产麻豆成人精品| 亚洲国产精品久久久男人的天堂| 亚洲美女一区二区三区| 中文字幕人成不卡一区| 韩国三级电影一区二区| 午夜av区久久| 视频一区视频二区中文字幕| 丰满白嫩尤物一区二区| 91高清视频在线| 久久精品人人做人人综合 | 91免费看视频| 亚洲综合丝袜美腿| 欧美岛国在线观看| 9i在线看片成人免费| 视频一区欧美日韩| 亚洲免费在线观看视频| 精品国产3级a| 制服.丝袜.亚洲.中文.综合| 国产一区二区三区综合| 久久精品视频一区二区三区| 丁香婷婷综合网| 欧美成人r级一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 欧美一级黄色大片| 极品少妇一区二区| 中文字幕免费不卡| 成人在线综合网| 国产日本亚洲高清| 99久精品国产| 婷婷综合五月天| 亚洲国产精品成人综合色在线婷婷 | 99re视频精品| 一区在线中文字幕| 在线观看亚洲精品视频| 韩国三级在线一区| 日韩美女精品在线| 在线看国产一区二区| 国产精品久久久久久久久图文区| 国产二区国产一区在线观看| 国产视频一区在线播放| 日本亚洲欧美天堂免费| 国产成人免费9x9x人网站视频| 日韩欧美不卡在线观看视频| 亚洲午夜视频在线观看| 欧美在线制服丝袜| 亚洲国产精品传媒在线观看| 久久99精品久久久久久| 欧美一区二区视频在线观看2020| 亚洲va中文字幕| 中文字幕日韩一区| 一色桃子久久精品亚洲| 欧美成人一区二区| 欧美系列一区二区| 欧美另类一区二区三区| 成人亚洲一区二区一| 日本成人在线视频网站| 久久男人中文字幕资源站| 国产在线精品一区二区夜色 | 中文字幕av一区二区三区免费看| 成人一区二区视频| 国产精品一级二级三级| 六月丁香婷婷久久| 国产乱子轮精品视频| 99久久久久免费精品国产| 在线播放亚洲一区| 国产精品久久久久久久久免费相片 | 国产麻豆精品在线| 成人看片黄a免费看在线| 欧美蜜桃一区二区三区| 91蜜桃网址入口| 成人黄色免费短视频| 精品一区二区三区不卡| 美女被吸乳得到大胸91| 久久精品国产77777蜜臀| 日本视频一区二区三区| 亚洲精品日产精品乱码不卡| 亚洲一区免费在线观看| 亚洲午夜视频在线观看| 日韩精品一二三四| 国产在线国偷精品产拍免费yy| 国产麻豆午夜三级精品| 国产乱子伦一区二区三区国色天香| 91丝袜呻吟高潮美腿白嫩在线观看| 在线中文字幕一区| 天天亚洲美女在线视频| 国产拍揄自揄精品视频麻豆| 久久久一区二区三区| 亚洲超碰精品一区二区| 国产精品中文字幕一区二区三区| 91麻豆国产自产在线观看| 亚洲成人777| 国产成a人亚洲| 欧美一区二区三区系列电影| 亚洲va韩国va欧美va| 欧美视频一区在线| 亚洲尤物在线视频观看| 欧美在线影院一区二区| 亚洲国产视频一区二区| 日本精品视频一区二区| 亚洲综合图片区| 99视频一区二区三区| 欧美一区二区三区播放老司机| 久久久久99精品一区| 中文字幕一区二区三区不卡| 亚洲色图欧美偷拍| 蜜桃视频一区二区三区在线观看| 色美美综合视频| 国产色综合久久| 亚洲成人激情自拍| 91蜜桃在线观看| 欧美一区二区三区白人| 久久精品一区二区三区四区| 五月激情综合婷婷| 欧美精品vⅰdeose4hd| 亚洲国产精品一区二区久久| 欧美成人精品二区三区99精品| 中文字幕一区二区三区乱码在线| 精品夜夜嗨av一区二区三区| 亚洲精品在线免费观看视频| 国产一区二区三区四区五区美女 | 日本不卡免费在线视频| 欧美性xxxxx极品少妇| 美国欧美日韩国产在线播放| 亚洲视频一二三| 精品国产乱码久久久久久夜甘婷婷| 高清视频一区二区| 中国av一区二区三区| 精品一区二区成人精品| 日韩一区二区免费视频| 一区二区三区免费看视频| 欧美性做爰猛烈叫床潮| 日本特黄久久久高潮| 国产精品欧美综合在线| 不卡影院免费观看| 亚洲精品成a人| 日韩午夜激情电影| 国产传媒久久文化传媒|