Package org.apache.felix.ipojo.manipulator

Examples of org.apache.felix.ipojo.manipulator.QuotedTokenizer


        if (value == null || value.trim().length() == 0) {
            return new HashMap<String, Map<String, String>>();
        }

        Map<String, Map<String, String>> result = new HashMap<String, Map<String, String>>();
        QuotedTokenizer qt = new QuotedTokenizer(value, ";=,");
        char del;
        do {
            boolean hadAttribute = false;
            Map<String, String> clause = new HashMap<String, String>();
            List<String> aliases = new ArrayList<String>();
            aliases.add(qt.nextToken());
            del = qt.getSeparator();
            while (del == ';') {
                String adname = qt.nextToken();
                if ((del = qt.getSeparator()) != '=') {
                    if (hadAttribute) {
                        throw new IllegalArgumentException("Header contains name field after attribute or directive: " + adname + " from " + value);
                    }
                    aliases.add(adname);
                } else {
                    String advalue = qt.nextToken();
                    clause.put(adname, advalue);
                    del = qt.getSeparator();
                    hadAttribute = true;
                }
            }
            for (Iterator<String> i = aliases.iterator(); i.hasNext();) {
                result.put(i.next(), clause);
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.manipulator.QuotedTokenizer

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.