Package com.rometools.rome.feed.synd

Examples of com.rometools.rome.feed.synd.SyndCategory


        if (message.getCategories() != null && message.getCategories().size() > 0) {
            out.startArray(Rss.CATEGORIES);
            for (Object oCategory : message.getCategories()) {
                if (oCategory instanceof SyndCategory) {
                    SyndCategory category = (SyndCategory) oCategory;
                    out.value(category.getName());
                }
            }
            out.endArray();
        }
View Full Code Here


        final List<Category> categories = entry.getCategories();
        if (categories != null) {
            final List<SyndCategory> syndCategories = new ArrayList<SyndCategory>();
            for (final Category category : categories) {
                final SyndCategory syndCategory = new SyndCategoryImpl();
                syndCategory.setName(category.getTerm());
                syndCategory.setTaxonomyUri(category.getSchemeResolved());
                // TODO: categories MAY have labels
                // syndCategory.setLabel(c.getLabel());
                syndCategories.add(syndCategory);
            }
            syndEntry.setCategories(syndCategories);
View Full Code Here

    }

    protected List<SyndCategory> createSyndCategories(final List<Category> rssCats) {
        final List<SyndCategory> syndCats = new ArrayList<SyndCategory>();
        for (final Category rssCat : rssCats) {
            final SyndCategory sCat = new SyndCategoryImpl();
            sCat.setTaxonomyUri(rssCat.getDomain());
            sCat.setName(rssCat.getValue());
            syndCats.add(sCat);
        }
        return syndCats;
    }
View Full Code Here

    protected void testCategories(final List<SyndCategory> cats, final String prefix) throws Exception {
        final Set<String> s1 = new HashSet<String>();
        final Set<String> s2 = new HashSet<String>();
        for (int i = 0; i < cats.size(); i++) {
            final SyndCategory cat = cats.get(i);
            s1.add(cat.getTaxonomyUri() + " " + cat.getName());
            s2.add(getPrefix() + "." + prefix + ".category[" + i + "]^domain" + " " + getPrefix() + "." + prefix + ".category[" + i + "]");
        }
        assertTrue(s1.equals(s2));
    }
View Full Code Here

TOP

Related Classes of com.rometools.rome.feed.synd.SyndCategory

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.