Package org.apache.abdera.model

Examples of org.apache.abdera.model.Source


     //http://feedvalidator.org/testcases/atom/4.2.11/multiple-alternates-matching.xml
     IRI uri = baseURI.resolve("4.2.11/multiple-alternates-matching.xml");
     Document<Feed> doc = get(uri);
     if (doc == null) return;
     Entry entry = doc.getRoot().getEntries().get(0);
     Source source = entry.getSource();
     assertEquals(source.getAlternateLink().getResolvedHref(), new IRI("http://example.org/front-page.html"));
   }  
View Full Code Here


     if (doc == null) return;
    
     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Source source = entry.getSource();
       assertNotNull(source);
       assertEquals(source.getAuthors().size(),2);
     }
   }
View Full Code Here

     if (doc == null) return;
    
     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Source source = entry.getSource();
       assertNotNull(source);
       assertEquals(source.getCategories().size(),2);
     }
   }  
View Full Code Here

     if (doc == null) return;
    
     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Source source = entry.getSource();
       assertNotNull(source);
       assertEquals(source.getContributors().size(),2);
     }
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.11/source-entry.xml
     IRI uri = baseURI.resolve("4.2.11/source-entry.xml");
     Document<Feed> doc = get(uri);
     if (doc == null) return;
     Entry entry = doc.getRoot().getEntries().get(0);
     Source source = entry.getSource();
     assertNotNull(source);
   }
View Full Code Here

    dateTime.setString(AtomDate.format(now));
    assertEquals(dateTime.getString(), AtomDate.format(now));
    assertEquals(dateTime.getDate(), now);
    Service service = factory.newService();
    assertNotNull(service);
    Source source = factory.newSource();
    assertNotNull(source);
    el = factory.newElement(Constants.NAME);
    assertNotNull(el);
    assertEquals(el.getQName(), Constants.NAME);
    el = factory.newElement(Constants.NAME);
View Full Code Here

    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }

  public Source getSource() {
    Source source = getExtension(RssConstants.QNAME_SOURCE);
    if (source == null) getExtension(RssConstants.QNAME_DC_SOURCE);
    return source;
  }
View Full Code Here

        List<Link> links = null;
        if (base instanceof Source) {
            links = ((Source)base).getLinks(Link.REL_LICENSE);
        } else if (base instanceof Entry) {
            Entry entry = (Entry)base;
            Source source = entry.getSource();
            Base parent = entry.getParentElement();
            links = entry.getLinks(Link.REL_LICENSE);
            if (inherited && (links == null || links.size() == 0) && source != null) {
                links = getLicense(source, false);
            }
View Full Code Here

            } else if (element instanceof Source) {
                jstream.startObject();
                writeLanguageFields(element, jstream);
                if (!isSameAsParentBase(element))
                    jstream.writeField("xml:base", element.getResolvedBaseUri());
                Source source = (Source)element;
                jstream.writeField("id", source.getId());
                writeElement("title", source.getTitleElement(), jstream);
                writeElement("subtitle", source.getSubtitleElement(), jstream);
                writeElement("rights", source.getRightsElement(), jstream);
                jstream.writeField("updated", source.getUpdated());
                writeElement("generator", source.getGenerator(), jstream);
                if (source.getIconElement() != null)
                    jstream.writeField("icon", source.getIconElement().getResolvedValue());
                if (source.getLogoElement() != null)
                    jstream.writeField("logo", source.getLogoElement().getResolvedValue());
                writeList("authors", source.getAuthors(), jstream);
                writeList("contributors", source.getContributors(), jstream);
                writeList("links", source.getLinks(), jstream);
                writeList("categories", source.getCategories(), jstream);
                if (FeedPagingHelper.isComplete(source))
                    jstream.writeField("complete", true);
                if (FeedPagingHelper.isArchive(source))
                    jstream.writeField("archive", true);
                if (source instanceof Feed) {
View Full Code Here

            if (altlink != null) {
                irt.setHref(altlink.getResolvedHref());
                if (altlink.getMimeType() != null)
                    irt.setMimeType(altlink.getMimeType());
            }
            Source src = ref.getSource();
            if (src != null) {
                Link selflink = src.getSelfLink();
                if (selflink != null)
                    irt.setSource(selflink.getResolvedHref());
            }
        } catch (Exception e) {
        }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Source

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.