private Category parseCategory(final String baseURI, final Element eCategory) { final Category category = new Category(); final String term = getAttributeValue(eCategory, "term"); if (term != null) { category.setTerm(term); } final String scheme = getAttributeValue(eCategory, "scheme"); if (scheme != null) { category.setScheme(scheme); if (isRelativeURI(scheme)) { category.setSchemeResolved(resolveURI(baseURI, eCategory, scheme)); } } final String label = getAttributeValue(eCategory, "label"); if (label != null) { category.setLabel(label); } return category; }
final com.rometools.rome.feed.atom.Category romeCategory = new com.rometools.rome.feed.atom.Category(); romeCategory.setTerm(cat.getId()); romeCategory.setScheme(cat.getUrl()); romeCategory.setLabel(cat.getName()); romeCats.add(romeCategory);
atomCat.setScheme(RollerAtomService.getWeblogCategoryScheme(entry.getWebsite())); atomCat.setTerm(entry.getCategory().getName()); categories.add(atomCat);
private Category parseCategory(final String baseURI, final Element eCategory) { final Category category = new Category(); final String term = getAttributeValue(eCategory, "term"); if (term != null) { category.setTerm(term); } final String scheme = getAttributeValue(eCategory, "scheme"); if (scheme != null) { category.setScheme(scheme); if (isRelativeURI(scheme)) { category.setSchemeResolved(resolveURI(baseURI, eCategory, scheme)); } } final String label = getAttributeValue(eCategory, "label"); if (label != null) { category.setLabel(label); } return category; }
protected void parseCategoriesElement(final Element catsElem) { if (catsElem.getAttribute("href", AtomService.ATOM_PROTOCOL) != null) { setHref(catsElem.getAttribute("href", AtomService.ATOM_PROTOCOL).getValue()); } if (catsElem.getAttribute("fixed", AtomService.ATOM_PROTOCOL) != null) { if ("yes".equals(catsElem.getAttribute("fixed", AtomService.ATOM_PROTOCOL).getValue())) { setFixed(true); } } if (catsElem.getAttribute("scheme", AtomService.ATOM_PROTOCOL) != null) { setScheme(catsElem.getAttribute("scheme", AtomService.ATOM_PROTOCOL).getValue()); } // Loop to parse <atom:category> elemenents to Category objects final List<Element> catElems = catsElem.getChildren("category", AtomService.ATOM_FORMAT); for (final Element catElem : catElems) { final Category cat = new Category(); cat.setTerm(catElem.getAttributeValue("term", AtomService.ATOM_FORMAT)); cat.setLabel(catElem.getAttributeValue("label", AtomService.ATOM_FORMAT)); cat.setScheme(catElem.getAttributeValue("scheme", AtomService.ATOM_FORMAT)); addCategory(cat); } }
aCat.setTerm(sCat.getName()); aCat.setScheme(sCat.getTaxonomyUri()); aCats.add(aCat);
aCat.setTerm(sCat.getName()); aCat.setScheme(sCat.getTaxonomyUri()); aCats.add(aCat);
aCat.setTerm(sCat.getName()); aCat.setScheme(sCat.getTaxonomyUri()); aCats.add(aCat);
aCat.setTerm(sCat.getName()); aCat.setScheme(sCat.getTaxonomyUri()); aCats.add(aCat);