Package org.apache.abdera.model

Examples of org.apache.abdera.model.Category


     //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);
     if (doc == null) return;
     Entry entry = doc.getRoot().getEntries().get(0);
     Category cat = entry.getCategories().get(0);
     assertEquals(cat.getLabel(), "<b>business</b>");
   }
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);
     if (doc == null) return;
     Entry entry = doc.getRoot().getEntries().get(0);
     Category cat = entry.getCategories().get(0);
     assertNull(cat.getLabel());
   }
View Full Code Here

  }

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

  }

  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;   
  }
View Full Code Here

    author.setUri("c");
    assertNotNull(author);
    assertEquals(author.getName(),"a");
    assertEquals(author.getEmail(), "b");
    assertEquals(author.getUri().toString(), "c");
    Category category = factory.newCategory();
    assertNotNull(category);
    category = factory.newCategory();
    category.setScheme("a");
    category.setTerm("b");
    category.setLabel("c");
    assertNotNull(category);
    assertEquals(category.getScheme().toString(), "a");
    assertEquals(category.getTerm(), "b");
    assertEquals(category.getLabel(), "c");
    Collection collection = factory.newCollection();
    assertNotNull(collection);
    Content content = factory.newContent(Content.Type.TEXT);
    assertNotNull(content);
    assertEquals(content.getContentType(), Content.Type.TEXT);
View Full Code Here

  }

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

  }

  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;   
  }
View Full Code Here

            } else if (element instanceof Category) {
                jstream.startObject();
                writeLanguageFields(element, jstream);
                if (!isSameAsParentBase(element))
                    jstream.writeField("xml:base", element.getResolvedBaseUri());
                Category category = (Category)element;
                jstream.writeField("term", category.getTerm());
                jstream.writeField("scheme", category.getScheme());
                jstream.writeField("label", category.getLabel());
                writeExtensions((ExtensibleElement)element, jstream);
                jstream.endObject();
            } else if (element instanceof Collection) {
                jstream.startObject();
                writeLanguageFields(element, jstream);
View Full Code Here

        author.setUri("c");
        assertNotNull(author);
        assertEquals("a", author.getName());
        assertEquals("b", author.getEmail());
        assertEquals("c", author.getUri().toString());
        Category category = factory.newCategory();
        assertNotNull(category);
        category = factory.newCategory();
        category.setScheme("a");
        category.setTerm("b");
        category.setLabel("c");
        assertNotNull(category);
        assertEquals("a", category.getScheme().toString());
        assertEquals("b", category.getTerm());
        assertEquals("c", category.getLabel());
        Collection collection = factory.newCollection();
        assertNotNull(collection);
        Content content = factory.newContent(Content.Type.TEXT);
        assertNotNull(content);
        assertEquals(Content.Type.TEXT, content.getContentType());
View Full Code Here

    }

    public Category addCategory(String term) {
        complete();
        FOMFactory factory = (FOMFactory)this.factory;
        Category category = factory.newCategory(this);
        category.setTerm(term);
        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.