Package org.apache.abdera.model

Examples of org.apache.abdera.model.Category


     //http://feedvalidator.org/testcases/atom/4.2.2.2/category-scheme-rel-iri.xml
     IRI uri = baseURI.resolve("4.2.2.2/category-scheme-rel-iri.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Category cat = entry.getCategories().get(0);
     assertEquals(cat.getScheme(), new IRI("mine"));
   }
View Full Code Here


     //http://feedvalidator.org/testcases/atom/4.2.2.3/category-label-escaped-html.xml
     IRI uri = baseURI.resolve("4.2.2.3/category-label-escaped-html.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Category cat = entry.getCategories().get(0);
     assertEquals(cat.getLabel(), "<b>business</b>");
   }
View Full Code Here

    addChild((OMElement)category);
  }

  public Category addCategory(String term) {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    return category;
  }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.2.3/category-no-label.xml
     IRI uri = baseURI.resolve("4.2.2.3/category-no-label.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Category cat = entry.getCategories().get(0);
     assertNull(cat.getLabel());
   }
View Full Code Here

    String scheme,
    String term,
    String label)
      throws IRISyntaxException {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    category.setScheme(scheme);
    category.setLabel(label);
    return category;   

  }
View Full Code Here

    List<Category> cats)
      throws IRISyntaxException {
    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;
  }
View Full Code Here

    addChild((OMElement)category);
  }

  public Category addCategory(String term) {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    return category;
  }
View Full Code Here

    return category;
  }

  public Category addCategory(String scheme, String term, String label) throws IRISyntaxException {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    category.setScheme(scheme);
    category.setLabel(label);
    return category;   
  }
View Full Code Here

    addChild((OMElement)category);
  }

  public Category addCategory(String term) {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    return category;
  }
View Full Code Here

    return category;
  }

  public Category addCategory(String scheme, String term, String label) throws IRISyntaxException {
    FOMFactory factory = (FOMFactory) this.factory;
    Category category = factory.newCategory(this);
    category.setTerm(term);
    category.setScheme(scheme);
    category.setLabel(label);
    return category;   
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.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.