Package org.apache.abdera.model

Examples of org.apache.abdera.model.IRIElement


        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


            _removeChildren(ID, false);
        return 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

        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

    public IRIElement setUri(String uri) {
        complete();
        if (uri != null) {
            FOMFactory fomfactory = (FOMFactory)factory;
            IRIElement el = fomfactory.newUri(null);
            el.setValue(uri);
            _setChild(URI, (OMElement)el);
            return el;
        } else {
            _removeChildren(URI, false);
            return null;
View Full Code Here

            return null;
        }
    }

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

      _removeChildren(ID, false);
    return 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

  public IRIElement setUri(String uri) {
    complete();
    if (uri != null) {
      FOMFactory fomfactory = (FOMFactory) factory;
      IRIElement el = fomfactory.newUri(null);
      el.setValue(uri);
      _setChild(URI, (OMElement)el);
      return el;
    } else {
      _removeChildren(URI, false);
      return null;
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.