yarfraw.core.datamodel
Class ItemEntry

java.lang.Object
  extended by yarfraw.core.datamodel.ItemEntry
All Implemented Interfaces:
Serializable

public class ItemEntry
extends Object

A channel may contain any number of ItemEntrys. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed; see examples), and the link and title may be omitted. All elements of an item are optional, however at least one of title or description must be present.

for Atom 1.0 format, the field also mapps to <entry> element.

Author:
jliang
See Also:
Serialized Form

Field Summary
protected  String _about
           
protected  String _base
           
protected  String _lang
           
protected  Map<QName,String> _otherAttributes
           
protected  List<Element> _otherElements
           
protected  String _resource
           
 
Constructor Summary
ItemEntry()
           
 
Method Summary
 ItemEntry addAuthorOrCreator(Person... authorOrCreator)
          Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
 ItemEntry addAuthorOrCreator(String... email)
          Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
 ItemEntry addCategorySubject(CategorySubject... categorySubject)
          Rss 1.0 - <dc:subject> The topic of the content of the resource.
 ItemEntry addCategorySubject(String... categorySubjectOrTerm)
          Rss 1.0 - <dc:subject> The topic of the content of the resource.
 ItemEntry addContributor(Person... contributor)
          Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
 ItemEntry addContributor(String... contributor)
          Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
 ItemEntry addLink(Link... link)
          Rss 1.0 - The item's URL.
 ItemEntry addLink(String... href)
          Rss 1.0 - The item's URL.
 ItemEntry addOtherAttributes(QName namespace, String attribute)
          Add an attribute that is not in the RSS 2.0 specs.
 ItemEntry addOtherElement(Element element)
          Add an element that is not specified in the Rss specs.
**Note** The element should not have an empty namespace to avoid collision with the specs elements.
 ItemEntry addOtherElement(String xmlString)
          Add an element that is not specified in the Rss specs.
**Note** The element should not have an empty namespace to avoid collision with the specs elements.
 boolean equals(Object other)
           
 String getAbout()
          This maps to the required 'about' attribute that present of all second level elements (channel, image, item, and textinput).
 String getAttributeValueByLocalName(String localName)
          Search for attributes that are not in the spec by its local name.
 String getAttributeValueByQName(QName name)
          Search for attributes that are not in the spec by its QName.
 List<Person> getAuthorOrCreator()
          Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
 String getBase()
          This maps to the 'base' attribute that is common in all Atom 1.0 elements.
 Set<CategorySubject> getCategorySubjects()
          Rss 1.0 - <dc:subject> The topic of the content of the resource.
 String getComments()
          Rss 1.0 - Not supported, this field is ignored.
 Content getContent()
          Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class.
 List<Person> getContributors()
          Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
 Text getDescriptionOrSummary()
          Rss 1.0 - A brief description/abstract of the item.
 String getDescriptionOrSummaryText()
          Rss 1.0 - A brief description/abstract of the item.
 Element getElementByLocalName(String localName)
          Search through the other element list and return the FIRST element that matches the input localName.
 Element getElementByNS(String namespaceURI, String localName)
          Search through the other element list and return the first element that matches both input the namespaceURI and the localName.
 Enclosure getEnclosure()
          Rss 1.0 - Not supported, this field is ignored.
 String getLang()
          The language attribute indicates the language that is used by the enclosed element.
 Locale getLangAsLocale()
          The language attribute indicates the language that is used by the enclosed element.
 List<Link> getLinks()
          Rss 1.0 - The item's URL.
 Map<QName,String> getOtherAttributes()
          Any other attribute that is not in the RSS specs.
 List<Element> getOtherElements()
          Other additional elements that are not in the Rss specs.
 String getPubDate()
          Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
 String getResource()
          This maps to the optional 'resource' attribute that present in some Rss 1.0 elements.
 Text getRights()
          Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
 String getRightsText()
          Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
 Source getSource()
          Rss 1.0 - Not supported, this field is ignored.
 Text getTitle()
          Rss 1.0 - The item's title.
 String getTitleText()
          Rss 1.0 - The item's title.
 Id getUid()
          Rss 1.0 - Not supported, this field is ignored.
 String getUpdatedDate()
          Rss 1.0 - Not supported, this field is ignored.
 int hashCode()
           
 ItemEntry setAbout(String about)
          Rss 1.0 only
 ItemEntry setAuthorOrCreator(List<Person> authorOrCreator)
          Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
 ItemEntry setBase(String base)
          Atom 1.0 only
Any element defined by this specification MAY have an xml:base attribute [W3C.REC-xmlbase-20010627].
 ItemEntry setCategorySubjects(Set<CategorySubject> categorySubjects)
          Rss 1.0 - <dc:subject> The topic of the content of the resource.
 ItemEntry setComments(String comments)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setContent(Content content)
          Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class.
 ItemEntry setContent(String contentText)
          Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class.
 ItemEntry setContributors(List<Person> contributors)
          Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
 ItemEntry setDescriptionOrSummary(String descriptionOrSummary)
          Rss 1.0 - A brief description/abstract of the item.
 ItemEntry setDescriptionOrSummary(Text descriptionOrSummary)
          Rss 1.0 - A brief description/abstract of the item.
 ItemEntry setEnclosure(Enclosure enclosure)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setLang(Locale lang)
          Rss 2.0 - <language> element.
 ItemEntry setLang(String lang)
          Rss 2.0 - <language> element.
 ItemEntry setLinks(List<Link> links)
          Rss 1.0 - The item's URL.
 ItemEntry setOtherAttributes(Map<QName,String> otherAttributes)
          Any other attribute that is not in the RSS 2.0 specs.
 ItemEntry setOtherElements(List<Element> otherElements)
          Other additional elements that are not in the Rss specs.
**Note** The element should not have an empty namespace to avoid collision with the specs elements.
 ItemEntry setPubDate(Date pubDate, SimpleDateFormat format)
          Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
 ItemEntry setPubDate(String pubDate)
          Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
 ItemEntry setResource(String resource)
          Rss 1.0 only
 ItemEntry setRights(String rights)
          Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
 ItemEntry setRights(Text rights)
          Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
 ItemEntry setSource(Source source)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setTitle(String title)
          Rss 1.0 - The item's title.
 ItemEntry setTitle(Text title)
          Rss 1.0 - The item's title.
 ItemEntry setUid(Id uid)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setUid(String uid)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setUpdatedDate(Date date, SimpleDateFormat format)
          Rss 1.0 - Not supported, this field is ignored.
 ItemEntry setUpdatedDate(String updatedDate)
          Rss 1.0 - Not supported, this field is ignored.
 String toString()
           
 void validate(FeedFormat format)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_base

protected String _base

_lang

protected String _lang

_resource

protected String _resource

_about

protected String _about

_otherAttributes

protected Map<QName,String> _otherAttributes

_otherElements

protected List<Element> _otherElements
Constructor Detail

ItemEntry

public ItemEntry()
Method Detail

getTitle

public Text getTitle()
  • Rss 1.0 - The item's title.
  • Rss 2.0 - The title of the item.
  • Atom 1.0 - The "atom:title" element is a Text construct that conveys a human-readable title for an entry or feed.
  • Returns:

    setTitle

    public ItemEntry setTitle(Text title)
  • Rss 1.0 - The item's title.
  • Rss 2.0 - The title of the item.
  • Atom 1.0 - The "atom:title" element is a Text construct that conveys a human-readable title for an entry or feed.
  • Parameters:
    title -
    Returns:

    setTitle

    public ItemEntry setTitle(String title)
  • Rss 1.0 - The item's title.
  • Rss 2.0 - The title of the item.
  • Atom 1.0 - The "atom:title" element is a Text construct that conveys a human-readable title for an entry or feed.

  • This method creates a new Text object using the input string and sets title to this object.

    Parameters:
    title -
    Returns:

    getTitleText

    public String getTitleText()
  • Rss 1.0 - The item's title.
  • Rss 2.0 - The title of the item.
  • Atom 1.0 - The "atom:title" element is a Text construct that conveys a human-readable title for an entry or feed.

  • Gets the text content of the title element.

    Returns:

    getLinks

    public List<Link> getLinks()
  • Rss 1.0 - The item's URL.
  • Rss 2.0 - The URL of the item.
  • Atom 1.0 - The "atom:link" element defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

  • Only Atom 1.0 supports multiple link elements. Both Rss 1.0 and Rss 2.0 will only use the FIRST link in the list as the link element

    Returns:

    setLinks

    public ItemEntry setLinks(List<Link> links)
  • Rss 1.0 - The item's URL.
  • Rss 2.0 - The URL of the item.
  • Atom 1.0 - The "atom:link" element defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

  • Only Atom 1.0 supports multiple link elements. Both Rss 1.0 and Rss 2.0 will only use the FIRST link in the list as the link element

    Parameters:
    links -
    Returns:

    addLink

    public ItemEntry addLink(String... href)
  • Rss 1.0 - The item's URL.
  • Rss 2.0 - The URL of the item.
  • Atom 1.0 - The "atom:link" element defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

  • This method creates new Link objects and adds them to the END of the links list.
    Only Atom 1.0 supports multiple link elements. Both Rss 1.0 and Rss 2.0 will only use the FIRST link in the list as the link element

    Parameters:
    href -
    Returns:

    addLink

    public ItemEntry addLink(Link... link)
  • Rss 1.0 - The item's URL.
  • Rss 2.0 - The URL of the item.
  • Atom 1.0 - The "atom:link" element defines a reference from an entry or feed to a Web resource. This specification assigns no meaning to the content (if any) of this element.

  • This method adds input Link to the END of the links list.
    Only Atom 1.0 supports multiple link elements. Both Rss 1.0 and Rss 2.0 will only use the FIRST link in the list as the link element

    Parameters:
    link -
    Returns:

    getDescriptionOrSummary

    public Text getDescriptionOrSummary()
  • Rss 1.0 - A brief description/abstract of the item.
  • Rss 2.0 - The item synopsis.
  • Atom 1.0 - The "atom:summary" element is a Text construct that conveys a short summary, abstract, or excerpt of an entry.

  • Note: for Rss 1.0, this is mapped to the <description> element, not the <dc:description> element.

    Returns:

    setDescriptionOrSummary

    public ItemEntry setDescriptionOrSummary(Text descriptionOrSummary)
  • Rss 1.0 - A brief description/abstract of the item.
  • Rss 2.0 - The item synopsis.
  • Atom 1.0 - The "atom:summary" element is a Text construct that conveys a short summary, abstract, or excerpt of an entry.
  • Parameters:
    descriptionOrSummary -
    Returns:

    setDescriptionOrSummary

    public ItemEntry setDescriptionOrSummary(String descriptionOrSummary)
  • Rss 1.0 - A brief description/abstract of the item.
  • Rss 2.0 - The item synopsis.
  • Atom 1.0 - The "atom:summary" element is a Text construct that conveys a short summary, abstract, or excerpt of an entry.

  • This method creates a new Text object of type 'text' with the input string as its text content.

    Parameters:
    descriptionOrSummary -
    Returns:

    getDescriptionOrSummaryText

    public String getDescriptionOrSummaryText()
  • Rss 1.0 - A brief description/abstract of the item.
  • Rss 2.0 - The item synopsis.
  • Atom 1.0 - The "atom:summary" element is a Text construct that conveys a short summary, abstract, or excerpt of an entry.

  • This methods gets the text content of the descriptionOrSummary field on the current instance.

    Returns:

    getAuthorOrCreator

    public List<Person> getAuthorOrCreator()
  • Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
  • Rss 2.0 - Email address of the author of the item.
  • Atom 1.0 - The "atom:author" element is a Person construct that indicates the author of the entry or feed.

  • Note: only Rss 1.0 and Rss 2.0 only uses the email field of a Person object, all the other fields are ignored.

    Returns:

    setAuthorOrCreator

    public ItemEntry setAuthorOrCreator(List<Person> authorOrCreator)
  • Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
  • Rss 2.0 - Email address of the author of the item.
  • Atom 1.0 - The "atom:author" element is a Person construct that indicates the author of the entry or feed.

  • Note: only Rss 1.0 and Rss 2.0 only uses the email field of a Person object, all the other fields are ignored.

    Parameters:
    author -
    Returns:

    addAuthorOrCreator

    public ItemEntry addAuthorOrCreator(String... email)
  • Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
  • Rss 2.0 - Email address of the author of the item.
  • Atom 1.0 - The "atom:author" element is a Person construct that indicates the author of the entry or feed.

  • This method constructs a new Person object using only the email address and adds them to the END of the authorOrCreator list.
    Note: only Rss 1.0 and Rss 2.0 only uses the email field of a Person object, all the other fields are ignored.

    Parameters:
    email -
    Returns:

    addAuthorOrCreator

    public ItemEntry addAuthorOrCreator(Person... authorOrCreator)
  • Rss 1.0 - <dc:creator> An entity primarily responsible for making the content of the resource.
  • Rss 2.0 - Email address of the author of the item.
  • Atom 1.0 - The "atom:author" element is a Person construct that indicates the author of the entry or feed.

  • This method constructs a new Person object using only the email address and adds them to the END of the authorOrCreator list.
    Note: only Rss 1.0 and Rss 2.0 only uses the email field of a Person object, all the other fields are ignored.

    Parameters:
    authorOrCreator -
    Returns:

    getContributors

    public List<Person> getContributors()
  • Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
    When this element is map to contributor in Rss 1.0, only the email address is used, other fields are ignored.
  • Rss 2.0 - Not supported, this list is ignored.
  • Atom 1.0 - The "atom:contributor" element is a Person construct that indicates a person or other entity who contributed to the entry or feed.
  • Returns:

    setContributors

    public ItemEntry setContributors(List<Person> contributors)
  • Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
    When this element is map to contributor in Rss 1.0, only the email address is used, other fields are ignored.
  • Rss 2.0 - Not supported, this list is ignored.
  • Atom 1.0 - The "atom:contributor" element is a Person construct that indicates a person or other entity who contributed to the entry or feed.
  • Parameters:
    contributors -
    Returns:

    addContributor

    public ItemEntry addContributor(Person... contributor)
  • Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
    When this element is map to contributor in Rss 1.0, only the email address is used, other fields are ignored.
  • Rss 2.0 - Not supported, this list is ignored.
  • Atom 1.0 - The "atom:contributor" element is a Person construct that indicates a person or other entity who contributed to the entry or feed.

  • This method adds the input contributor to the END of the contributors list.

    Parameters:
    contributor -
    Returns:

    addContributor

    public ItemEntry addContributor(String... contributor)
  • Rss 1.0 - <dc:contributor> An entity responsible for making contributions to the content of the resource.
    When this element is map to contributor in Rss 1.0, only the email address is used, other fields are ignored.
  • Rss 2.0 - Not supported, this list is ignored.
  • Atom 1.0 - The "atom:contributor" element is a Person construct that indicates a person or other entity who contributed to the entry or feed.

  • This method adds the input contributor to the END of the contributors list.

    Parameters:
    contributor -
    Returns:

    getCategorySubjects

    public Set<CategorySubject> getCategorySubjects()
  • Rss 1.0 - <dc:subject> The topic of the content of the resource.
  • Rss 2.0 - Includes the item in one or more categories.
  • Atom 1.0 - The "atom:category" element conveys information about a category associated with an entry or feed. This specification assigns no meaning to the content (if any) of this element.
  • Returns:

    setCategorySubjects

    public ItemEntry setCategorySubjects(Set<CategorySubject> categorySubjects)
  • Rss 1.0 - <dc:subject> The topic of the content of the resource.
  • Rss 2.0 - Includes the item in one or more categories.
  • Atom 1.0 - The "atom:category" element conveys information about a category associated with an entry or feed. This specification assigns no meaning to the content (if any) of this element.
  • Parameters:
    categorySubjects -
    Returns:

    addCategorySubject

    public ItemEntry addCategorySubject(String... categorySubjectOrTerm)
  • Rss 1.0 - <dc:subject> The topic of the content of the resource.
  • Rss 2.0 - Includes the item in one or more categories.
  • Atom 1.0 - The "atom:category" element conveys information about a category associated with an entry or feed. This specification assigns no meaning to the content (if any) of this element.

  • This method creates new CategorySubject objects using the input strings and add them to the category set.

    Parameters:
    categorySubjectOrTerm -
    Returns:

    addCategorySubject

    public ItemEntry addCategorySubject(CategorySubject... categorySubject)
  • Rss 1.0 - <dc:subject> The topic of the content of the resource.
  • Rss 2.0 - Includes the item in one or more categories.
  • Atom 1.0 - The "atom:category" element conveys information about a category associated with an entry or feed. This specification assigns no meaning to the content (if any) of this element.

  • This method adds the input CategorySubject objects to the category set.

    Parameters:
    categorySubject -
    Returns:

    getComments

    public String getComments()
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - URL of a page for comments relating to the item.
  • Atom 1.0 - Not supported, this is field is ignored.
  • Returns:

    setComments

    public ItemEntry setComments(String comments)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - URL of a page for comments relating to the item.
  • Atom 1.0 - Not supported, this is field is ignored.
  • Parameters:
    comments -
    Returns:

    getEnclosure

    public Enclosure getEnclosure()
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - Describes a media object that is attached to the item.
  • Atom 1.0 - Not supported, this field is ignored.
  • Returns:

    setEnclosure

    public ItemEntry setEnclosure(Enclosure enclosure)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - Describes a media object that is attached to the item.
  • Atom 1.0 - Not supported, this field is ignored.
  • Parameters:
    enclosure -
    Returns:

    getUid

    public Id getUid()
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - <guid> A string that uniquely identifies the item.
  • Atom 1.0 - The "atom:id" element conveys a permanent, universally unique identifier for an entry or feed.
  • Returns:

    setUid

    public ItemEntry setUid(Id uid)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - <guid> A string that uniquely identifies the item.
  • Atom 1.0 - The "atom:id" element conveys a permanent, universally unique identifier for an entry or feed.
  • Parameters:
    uid -
    Returns:

    setUid

    public ItemEntry setUid(String uid)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - <guid> A string that uniquely identifies the item.
  • Atom 1.0 - The "atom:id" element conveys a permanent, universally unique identifier for an entry or feed.

  • This method constructs a new Id object and sets the uid field to this object.

    Parameters:
    uid -
    Returns:

    getPubDate

    public String getPubDate()
  • Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
  • Rss 2.0 - <pubDate> Indicates when the item was published.
  • Atom 1.0 - <published> The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.
  • Returns:

    setPubDate

    public ItemEntry setPubDate(String pubDate)
  • Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
  • Rss 2.0 - <pubDate> Indicates when the item was published.
  • Atom 1.0 - <published> The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.
  • Parameters:
    pubDate -
    Returns:

    setPubDate

    public ItemEntry setPubDate(Date pubDate,
                                SimpleDateFormat format)
  • Rss 1.0 - <dc:date> A date associated with an event in the life cycle of the resource.
  • Rss 2.0 - <pubDate> Indicates when the item was published.
  • Atom 1.0 - <published> The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.

  • This method uses the input SimpleDateFormat object to format the date into a string.

    Parameters:
    pubDate -
    format -
    Returns:

    getUpdatedDate

    public String getUpdatedDate()
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <updated> The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed atom:updated value.
  • Returns:

    setUpdatedDate

    public ItemEntry setUpdatedDate(String updatedDate)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <updated> The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed atom:updated value.
  • Parameters:
    updatedDate -
    Returns:

    setUpdatedDate

    public ItemEntry setUpdatedDate(Date date,
                                    SimpleDateFormat format)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <updated> The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed atom:updated value.

  • This method uses the input SimpleDateFormat object to format the date into a string.

    Parameters:
    date -
    format -
    Returns:

    getSource

    public Source getSource()
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - The RSS channel that the item came from.
  • Atom 1.0 - Not supported, this field is ignored.
  • Returns:

    setSource

    public ItemEntry setSource(Source source)
  • Rss 1.0 - Not supported, this field is ignored.
  • Rss 2.0 - <source> The RSS channel that the item came from.
  • Atom 1.0 - Not supported, this field is ignored.
  • Parameters:
    source -
    Returns:

    getRights

    public Text getRights()
  • Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <rights> The "atom:rights" element is a Text construct that conveys information about rights held in and over an entry or feed.
  • Returns:

    getRightsText

    public String getRightsText()
  • Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <rights> The "atom:rights" element is a Text construct that conveys information about rights held in and over an entry or feed.
  • Returns:
    the text content of the rights field.

    setRights

    public ItemEntry setRights(Text rights)
  • Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <rights> The "atom:rights" element is a Text construct that conveys information about rights held in and over an entry or feed.
  • Parameters:
    rights -
    Returns:

    setRights

    public ItemEntry setRights(String rights)
  • Rss 1.0 - <dc:rights> Information about rights held in and over the resource.
  • Rss 2.0 - Not supported, this field is ignored.
  • Atom 1.0 - <rights> The "atom:rights" element is a Text construct that conveys information about rights held in and over an entry or feed.

  • This method creates a new Text object using the input string as its content and sets rights field to this object.

    Parameters:
    rights -
    Returns:

    getContent

    public Content getContent()
  • Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Rss 1.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Atom 1.0 - <content> The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.
  • Returns:

    setContent

    public ItemEntry setContent(Content content)
  • Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Rss 1.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Atom 1.0 - <content> The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.
  • Parameters:
    content -
    Returns:

    setContent

    public ItemEntry setContent(String contentText)
  • Rss 2.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Rss 1.0 - This is not officially supported, but if there's a <content:encoded /> element under <Item>, the content of the encoded element will be mapped to this class. The type will always be 'text' in this case.
  • Atom 1.0 - <content> The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.

  • This method constructs a new Content object of type 'text' and uses the input string as its text content.

    Parameters:
    contentText -
    Returns:

    setOtherAttributes

    public ItemEntry setOtherAttributes(Map<QName,String> otherAttributes)
    Any other attribute that is not in the RSS 2.0 specs.


    addOtherAttributes

    public ItemEntry addOtherAttributes(QName namespace,
                                        String attribute)
    Add an attribute that is not in the RSS 2.0 specs.


    setOtherElements

    public ItemEntry setOtherElements(List<Element> otherElements)
    Other additional elements that are not in the Rss specs.
    **Note** The element should not have an empty namespace to avoid collision with the specs elements.


    addOtherElement

    public ItemEntry addOtherElement(Element element)
    Add an element that is not specified in the Rss specs.
    **Note** The element should not have an empty namespace to avoid collision with the specs elements.

    Parameters:
    element - - any element

    addOtherElement

    public ItemEntry addOtherElement(String xmlString)
                              throws SAXException,
                                     IOException,
                                     ParserConfigurationException
    Add an element that is not specified in the Rss specs.
    **Note** The element should not have an empty namespace to avoid collision with the specs elements.

    Parameters:
    xmlString - - any element
    Throws:
    ParserConfigurationException
    IOException
    SAXException

    setBase

    public ItemEntry setBase(String base)
    Atom 1.0 only
    Any element defined by this specification MAY have an xml:base attribute [W3C.REC-xmlbase-20010627]. When xml:base is used in an Atom Document, it serves the function described in section 5.1.1 of [RFC3986], establishing the base URI (or IRI) for resolving any relative references found within the effective scope of the xml:base attribute.

    Parameters:
    base -
    Returns:

    setLang

    public ItemEntry setLang(String lang)
  • Rss 2.0 - <language> element. The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C. Only <channel> support this element.
  • Rss 1.0 - <dc:language> element. A language of the intellectual content of the resource. Only <channel> and <item> support this element.
  • Atom 1.0 - 'lang' attribute

  • Note: for Rss 2.0 and Rss 1.0, only <channel> and <item>

    Parameters:
    lang -
    Returns:

    setLang

    public ItemEntry setLang(Locale lang)
  • Rss 2.0 - <language> element. The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C. Only <channel> support this element.
  • Rss 1.0 - <dc:language> element. A language of the intellectual content of the resource. Only <channel> and <item> support this element.
  • Atom 1.0 - 'lang' attribute

  • Note: for Rss 2.0 and Rss 1.0, only <channel> and <item>

    Parameters:
    lang -
    Returns:

    setResource

    public ItemEntry setResource(String resource)
    Rss 1.0 only

    Parameters:
    resource -
    Returns:

    setAbout

    public ItemEntry setAbout(String about)
    Rss 1.0 only

    Parameters:
    about -
    Returns:

    validate

    public void validate(FeedFormat format)
                  throws ValidationException
    Throws:
    ValidationException

    getBase

    public String getBase()
    This maps to the 'base' attribute that is common in all Atom 1.0 elements. Other FeedFormat will ignore this attribute.

    Returns:
    - attribute value.

    getLang

    public String getLang()
    The language attribute indicates the language that is used by the enclosed element.

    Returns:
    - attribute value.

    getLangAsLocale

    public Locale getLangAsLocale()
    The language attribute indicates the language that is used by the enclosed element.

    Returns:
    - a new Locale Object by parsing the lang attribute.

    getResource

    public String getResource()
    This maps to the optional 'resource' attribute that present in some Rss 1.0 elements. Other FeedFormat will ignore this attribute.

    Returns:
    - attribute value.

    getAbout

    public String getAbout()
    This maps to the required 'about' attribute that present of all second level elements (channel, image, item, and textinput). Other FeedFormat will ignore this attribute.

    Returns:
    - attribute value.

    getOtherElements

    public List<Element> getOtherElements()
    Other additional elements that are not in the Rss specs.


    getElementByNS

    public Element getElementByNS(String namespaceURI,
                                  String localName)
    Search through the other element list and return the first element that matches both input the namespaceURI and the localName.

    Parameters:
    namespaceURI - - namespaceURI of the element to be search for
    localName - - localName of the element
    Returns:
    - null if no matching element is found, the matching element otherwise.

    getElementByLocalName

    public Element getElementByLocalName(String localName)
    Search through the other element list and return the FIRST element that matches the input localName.

    Parameters:
    localName - - localName of the element
    Returns:
    - null if no matching element is found, the matching element otherwise.

    getOtherAttributes

    public Map<QName,String> getOtherAttributes()
    Any other attribute that is not in the RSS specs.


    getAttributeValueByLocalName

    public String getAttributeValueByLocalName(String localName)
    Search for attributes that are not in the spec by its local name.

    Parameters:
    localName - localName of the attribute
    Returns:
    null if attribute is not found, the value of the attribute otherwise

    getAttributeValueByQName

    public String getAttributeValueByQName(QName name)
    Search for attributes that are not in the spec by its QName.

    Parameters:
    name - QName of the attribute
    Returns:
    null if attribute is not found, the value of the attribute otherwise

    toString

    public String toString()
    Overrides:
    toString in class Object

    equals

    public boolean equals(Object other)
    Overrides:
    equals in class Object

    hashCode

    public int hashCode()
    Overrides:
    hashCode in class Object


    Copyright © 2008. All Rights Reserved.