Package org.restlet.ext.atom

Examples of org.restlet.ext.atom.Category


                startLink(this.currentLink);
            } else if (localName.equalsIgnoreCase("entry")) {
                this.state = State.FEED_ENTRY;
                startEntry(this.currentEntry);
            } else if (localName.equals("category")) {
                this.currentCategory = new Category();
                this.currentCategory.setTerm(attrs.getValue("", "term"));
                this.currentCategory.setScheme(new Reference(attrs.getValue("",
                        "scheme")));
                this.currentCategory.setLabel(attrs.getValue("", "label"));
View Full Code Here


                    this.currentEntry = new Entry();
                    this.state = State.FEED_ENTRY;
                }
                startEntry(this.currentEntry);
            } else if (localName.equals("category")) {
                this.currentCategory = new Category();
                this.currentCategory.setTerm(attrs.getValue("", "term"));
                this.currentCategory.setScheme(new Reference(attrs.getValue("",
                        "scheme")));
                this.currentCategory.setLabel(attrs.getValue("", "label"));
View Full Code Here

                this.categories.setScheme((attr == null) ? null
                        : new Reference(attr));
            }
        } else if (uri.equalsIgnoreCase(Feed.ATOM_NAMESPACE)) {
            if (localName.equalsIgnoreCase("category")) {
                Category category = new Category();

                if (this.categories.getEntries() == null) {
                    this.categories.setEntries(new ArrayList<Category>());
                }
                this.categories.getEntries().add(category);

                String attr = attrs.getValue("", "term");
                category.setTerm((attr == null) ? null : attr);
                attr = attrs.getValue("", "label");
                category.setLabel((attr == null) ? null : attr);
                attr = attrs.getValue("", "scheme");
                category.setScheme((attr == null) ? null : new Reference(attr));

                if (category.getScheme() == null) {
                    category.setScheme(this.categories.getScheme());
                }
            }
        }
    }
View Full Code Here

        if (feed != null && feed.getEntries() != null
                && !feed.getEntries().isEmpty()) {
            for (Entry entry : feed.getEntries()) {
                if (entry.getCategories() != null
                        && !entry.getCategories().isEmpty()) {
                    Category category = entry.getCategories().get(0);
                    try {
                        result = Class.forName(TypeUtils
                                .getFullClassName(category.getTerm()));
                        break;
                    } catch (ClassNotFoundException e) {
                        continue;
                    }
                }
View Full Code Here

    entry.getLinks().add(newLink(result.getPath()));
    return entry;
  }
 
  private Category newCategory(String label) {
    Category c = new Category();
    c.setLabel(label);
    return c;
  }
View Full Code Here

TOP

Related Classes of org.restlet.ext.atom.Category

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.