Package org.apache.abdera.model

Examples of org.apache.abdera.model.IRIElement


      return null;
    }
  }
 
  public IRI getUri() {
    IRIElement iri = getUriElement();
    return (iri != null) ? iri.getResolvedValue() : null;
  }
View Full Code Here


      _removeChildren(ID, false);
    return (T)this;
  }

  public IRI getId() {
    IRIElement id = getIdElement();
    return (id != null) ? id.getValue() : null;
  }
View Full Code Here

    complete();
    if (value == null) {
      _removeChildren(ID, false);
      return null;
    }
    IRIElement id = getIdElement();
    if (id != null) {
      if (normalize) id.setNormalizedValue(value);
      else id.setValue(value);
      return id;
    } else {
      FOMFactory fomfactory = (FOMFactory) factory;
      IRIElement iri = fomfactory.newID(this);
      iri.setValue((normalize) ? IRI.normalizeString(value) : value);
      return iri;
    }
  }
View Full Code Here

    if (value == null) {
      _removeChildren(ICON, false);
      return null;
    }
    FOMFactory fomfactory = (FOMFactory) factory;
    IRIElement iri = fomfactory.newIcon(this);
    iri.setValue(value);
    return iri;
  }
View Full Code Here

    iri.setValue(value);
    return iri;
  }
 
  public IRI getIcon() {
    IRIElement iri = getIconElement();
    IRI uri = (iri != null) ? iri.getResolvedValue() : null;
    return (IRIHelper.isJavascriptUri(uri) ||
        IRIHelper.isMailtoUri(uri)) ? null : uri;
  }
View Full Code Here

    if (value == null) {
      _removeChildren(LOGO, false);
      return null;
    }
    FOMFactory fomfactory = (FOMFactory) factory;
    IRIElement iri = fomfactory.newLogo(this);
    iri.setValue(value);
    return iri;
  }
View Full Code Here

    iri.setValue(value);
    return iri;
  }
 
  public IRI getLogo() {
    IRIElement iri = getLogoElement();
    IRI uri = (iri != null) ? iri.getResolvedValue() : null;
    return (IRIHelper.isJavascriptUri(uri) ||
        IRIHelper.isMailtoUri(uri)) ? null : uri;
  }
View Full Code Here

        Person person = feed.getAuthor();
        assertNotNull(person);
        assertEquals("John Doe", person.getName());
        assertNull(person.getEmail());
        assertNull(person.getUri());
        IRIElement id = feed.getIdElement();
        assertNotNull(id);
        assertEquals(new IRI("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"), id.getValue());
        List<Entry> entries = feed.getEntries();
        assertEquals(1, entries.size());
        for (Entry entry : entries) {
            title = entry.getTitleElement();
            assertNotNull(title);
            assertEquals(Text.Type.TEXT, title.getTextType());
            value = title.getValue();
            assertEquals("Atom-Powered Robots Run Amok", value);
            links = entry.getLinks();
            assertEquals(1, links.size());
            for (Link link : links) {
                assertNull(link.getRel()); // it's an alternate link
                assertEquals(new IRI("http://example.org/2003/12/13/atom03"), link.getHref());
                assertNull(link.getHrefLang());
                assertNull(link.getMimeType());
                assertNull(link.getTitle());
                assertEquals(-1, link.getLength());
            }
            links = entry.getLinks(Link.REL_ALTERNATE);
            assertEquals(1, links.size());
            links = entry.getLinks(Link.REL_RELATED);
            assertEquals(0, links.size());
            id = entry.getIdElement();
            assertNotNull(id);
            assertEquals(new IRI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"), id.getValue());
            assertNotNull(entry.getUpdatedElement());
            dte = entry.getUpdatedElement();
            dt = dte.getValue();
            assertNotNull(dt);
            c = dt.getCalendar();
View Full Code Here

        Feed feed = doc.getRoot();
        assertNotNull(feed);
        List<Entry> entries = feed.getEntries();
        assertNotNull(entries);
        for (Entry entry : entries) {
            IRIElement id = entry.getIdElement();
            assertNotNull(id);
            try {
                id.getValue();
            } catch (Exception e) {
                assertTrue(e instanceof IRISyntaxException);
            }
        }
    }
View Full Code Here

    Person person = feed.getAuthor();
    assertNotNull(person);
    assertEquals(person.getName(), "John Doe");
    assertNull(person.getEmail());
    assertNull(person.getUri());
    IRIElement id = feed.getIdElement();
    assertNotNull(id);
    assertEquals(id.getValue(), new IRI("urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"));
    List<Entry> entries = feed.getEntries();
    assertEquals(entries.size(), 1);
    for (Entry entry : entries) {
      title = entry.getTitleElement();
      assertNotNull(title);
      assertEquals(title.getTextType(), Text.Type.TEXT);
      value = title.getValue();
      assertEquals(value, "Atom-Powered Robots Run Amok");
      links = entry.getLinks();
      assertEquals(1, links.size());
      for (Link link : links) {
        assertNull(link.getRel()); // it's an alternate link
        assertEquals(link.getHref(), new IRI("http://example.org/2003/12/13/atom03"));
        assertNull(link.getHrefLang());
        assertNull(link.getMimeType());
        assertNull(link.getTitle());
        assertEquals(link.getLength(),-1);
      }
      links = entry.getLinks(Link.REL_ALTERNATE);
      assertEquals(links.size(),1);
      links = entry.getLinks(Link.REL_RELATED);
      assertEquals(links.size(),0);
      id = entry.getIdElement();
      assertNotNull(id);
      assertEquals(id.getValue(), new IRI("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"));
      assertNotNull(entry.getUpdatedElement());
      dte = entry.getUpdatedElement();
      dt = dte.getValue();
      assertNotNull(dt);
      c = dt.getCalendar();
View Full Code Here

TOP

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

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.