private List<Category> copyCategoriesWithScheme(List<Category> cats) { List<Category> newcats = new ArrayList<Category>(); IRI scheme = getScheme(); for (Category cat : cats) { Category newcat = (Category)cat.clone(); if (newcat.getScheme() == null && scheme != null) newcat.setScheme(scheme.toString()); newcats.add(newcat); } return newcats; }
public Category addCategory(String scheme, String term, String label) { complete(); FOMFactory factory = (FOMFactory)this.factory; Category category = factory.newCategory(this); category.setTerm(term); category.setScheme(scheme); category.setLabel(label); return category; }
public Category addCategory(String scheme, String term, String label) { complete(); FOMFactory factory = (FOMFactory)this.factory; Category category = factory.newCategory(this); category.setTerm(term); category.setScheme(scheme); category.setLabel(label); return category; }
public Category addCategory(String scheme, String term, String label) { complete(); FOMFactory factory = (FOMFactory)this.factory; Category category = factory.newCategory(this); category.setTerm(term); category.setScheme(scheme); category.setLabel(label); return category; }
public Category asCategoryElement(RequestContext request) { Category cat = request.getAbdera().getFactory().newCategory(); cat.setTerm(term); if (scheme != null) cat.setScheme(scheme); if (label != null) cat.setLabel(label); return cat; } }
public Entry addCategory(Category category) { complete(); Element el = category.getParentElement(); if (el != null && el instanceof Categories) { Categories cats = category.getParentElement(); category = (Category)category.clone(); try { if (category.getScheme() == null && cats.getScheme() != null) category.setScheme(cats.getScheme().toString()); } catch (Exception e) { // Do nothing, shouldn't happen } } addChild((OMElement)category); return this; }
public <T extends Source> T addCategory(Category category) { complete(); Element el = category.getParentElement(); if (el != null && el instanceof Categories) { Categories cats = category.getParentElement(); category = (Category)category.clone(); try { if (category.getScheme() == null && cats.getScheme() != null) category.setScheme(cats.getScheme().toString()); } catch (Exception e) { // Do nothing, shouldn't happen } } addChild((OMElement)category); return (T)this; }