Package com.alibaba.cobar.client.router.config.vo

Examples of com.alibaba.cobar.client.router.config.vo.InternalRules


        xstream.useAttributeFor(InternalRule.class, "merger");

        List<InternalRule> rules = new ArrayList<InternalRule>();

        if (getConfigLocation() != null) {
            InternalRules internalRules = (InternalRules) xstream.fromXML(getConfigLocation()
                    .getInputStream());
            if (!CollectionUtils.isEmpty(internalRules.getRules())) {
                rules.addAll(internalRules.getRules());
            }
        }
        if (getConfigLocations() != null && getConfigLocations().length > 0) {
            for (Resource resource : getConfigLocations()) {
                InternalRules internalRules = (InternalRules) xstream.fromXML(resource
                        .getInputStream());
                if (!CollectionUtils.isEmpty(internalRules.getRules())) {
                    rules.addAll(internalRules.getRules());
                }
            }
        }

        return rules;
View Full Code Here


        xstream.alias("rules", InternalRules.class);
        xstream.alias("rule", InternalRule.class);
        xstream.addImplicitCollection(InternalRules.class, "rules");
        xstream.useAttributeFor(InternalRule.class, "merger");

        InternalRules internalRules = (InternalRules) xstream.fromXML(configLocation
                .getInputStream());
        List<InternalRule> rules = internalRules.getRules();
        if (CollectionUtils.isEmpty(rules)) {
            return;
        }

        for (InternalRule rule : rules) {
View Full Code Here

TOP

Related Classes of com.alibaba.cobar.client.router.config.vo.InternalRules

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.