com.google.gdata.model.atom
Class Source

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.atom.Source
Direct Known Subclasses:
Feed

public class Source
extends Element

The Source class represents an Atom feed source object primarily on the data model for an <atom:source> element.

Here is the Relax-NG schema that represents an Atom 1.0 Source:

 atomSource =
   element atom:source {
     atomCommonAttributes,
     (atomAuthor*
      & atomCategory*
      & atomContributor*
      & atomGenerator?
      & atomIcon?
      & atomId?
      & atomLink*
      & atomLogo?
      & atomRights?
      & atomSubtitle?
      & atomTitle?
      & atomUpdated?
      & extensionElement*)
   }
 


Nested Class Summary
static class Source.Generator
          Class representing atom:generator.
 
Field Summary
static ElementKey<java.lang.Void,Source> CONSTRUCT
          The key for Source used as a construct.
static ElementKey<java.net.URI,Element> ICON
          atom:icon
static ElementKey<java.lang.String,Element> ID
          The atom:id element.
static ElementKey<java.lang.Void,Source> KEY
          The key for this element.
static ElementKey<java.net.URI,Element> LOGO
          atom:logo
static ElementKey<java.lang.String,TextContent> RIGHTS
          atom:rights
static ElementKey<java.lang.String,TextContent> SUBTITLE
          atom:subtitle
static ElementKey<java.lang.String,TextContent> TITLE
          atom:title
static ElementKey<DateTime,Element> UPDATED
          atom:updated
 
Constructor Summary
  Source()
          Constructs a new instance using the default metadata.
protected Source(ElementKey<?,? extends Source> key)
          Constructs a new instance using the specified element metadata.
protected Source(ElementKey<?,? extends Source> key, Element source)
          Copy constructor that initializes a new Source instance to have identical contents to another element, using a shared state.
protected Source(Source sourceSource)
          Copy constructor that initializes a new Source instance to have identical contents to another instance, using a shared reference to the same child element instances.
 
Method Summary
 void addAuthor(Person v)
           
 void addAuthors(java.util.List<Person> v)
           
 void addCategory(Category v)
           
 void addContributor(Person v)
           
 void addContributors(java.util.List<Person> v)
           
 void addHtmlLink(java.lang.String htmlUrl, java.lang.String lang, java.lang.String title)
          Adds a link pointing to an HTML representation.
 void addLink(Link v)
           
 Link addLink(java.lang.String rel, java.lang.String type, java.lang.String href)
           
 void clearAuthors()
           
 void clearCategories()
           
 void clearContributors()
           
 void clearLinks()
           
 java.util.List<Person> getAuthors()
           
 java.util.Set<Category> getCategories()
           
 java.util.List<Person> getContributors()
           
 Source.Generator getGenerator()
           
 Link getHtmlLink()
          Retrieves the first HTML link.
 java.lang.String getIcon()
          Deprecated. Use getIconUri() instead.
 java.net.URI getIconUri()
          Gets icon URI associated with source.
 java.lang.String getId()
           
 Link getLink(java.lang.String rel, java.lang.String type)
          Retrieves the first link with the supplied rel and/or type value.
 java.util.List<Link> getLinks()
           
 java.util.List<Link> getLinks(java.lang.String relToMatch, java.lang.String typeToMatch)
          Return the links that match the given rel and type values.
 java.lang.String getLogo()
          Deprecated. Use getLogoUri() instead.
 java.net.URI getLogoUri()
          Gets logo URI associated with source.
 TextContent getRights()
           
 TextContent getSubtitle()
           
 TextContent getTitle()
           
 DateTime getUpdated()
           
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 boolean removeAuthor(Person v)
           
 boolean removeContributor(Person v)
           
 boolean removeLink(Link link)
           
 void removeLinks(java.lang.String relToMatch, java.lang.String typeToMatch)
          Remove all links that match the given rel and type values.
 void setGenerator(Source.Generator v)
           
 Source.Generator setGenerator(java.lang.String version, java.lang.String uri, java.lang.String name)
           
 void setIcon(java.lang.String v)
          Deprecated. Use setIcon(URI) instead.
 void setIcon(java.net.URI v)
          Sets icon URI associated with source.
 void setId(java.lang.String v)
           
 void setLogo(java.lang.String v)
          Deprecated. Use setLogo(URI) instead.
 void setLogo(java.net.URI v)
          Sets logo URI associated with source.
 void setRights(TextContent v)
           
 void setSubtitle(TextContent v)
           
 void setTitle(TextContent v)
           
 void setUpdated(DateTime v)
           
 
Methods inherited from class com.google.gdata.model.Element
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, equals, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hashCode, hasTextValue, isLocked, lock, narrow, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, validate, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONSTRUCT

public static final ElementKey<java.lang.Void,Source> CONSTRUCT
The key for Source used as a construct. This will apply to all uses of Source regardless of QName, in particular to Feed.


KEY

public static final ElementKey<java.lang.Void,Source> KEY
The key for this element.


ID

public static final ElementKey<java.lang.String,Element> ID
The atom:id element. somewhere else.


UPDATED

public static final ElementKey<DateTime,Element> UPDATED
atom:updated


TITLE

public static final ElementKey<java.lang.String,TextContent> TITLE
atom:title


SUBTITLE

public static final ElementKey<java.lang.String,TextContent> SUBTITLE
atom:subtitle


RIGHTS

public static final ElementKey<java.lang.String,TextContent> RIGHTS
atom:rights


ICON

public static final ElementKey<java.net.URI,Element> ICON
atom:icon


LOGO

public static final ElementKey<java.net.URI,Element> LOGO
atom:logo

Constructor Detail

Source

public Source()
Constructs a new instance using the default metadata.


Source

protected Source(ElementKey<?,? extends Source> key)
Constructs a new instance using the specified element metadata.

Parameters:
key - element key for this element.

Source

protected Source(Source sourceSource)
Copy constructor that initializes a new Source instance to have identical contents to another instance, using a shared reference to the same child element instances. Default metadata is used.


Source

protected Source(ElementKey<?,? extends Source> key,
                 Element source)
Copy constructor that initializes a new Source instance to have identical contents to another element, using a shared state. The element key is given by the caller.

Parameters:
key - element key to associate with copy
source - source to copy data from
Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


getId

public java.lang.String getId()

setId

public void setId(java.lang.String v)

getUpdated

public DateTime getUpdated()

setUpdated

public void setUpdated(DateTime v)

getCategories

public java.util.Set<Category> getCategories()

addCategory

public void addCategory(Category v)

clearCategories

public void clearCategories()

getTitle

public TextContent getTitle()

setTitle

public void setTitle(TextContent v)

getSubtitle

public TextContent getSubtitle()

setSubtitle

public void setSubtitle(TextContent v)

getRights

public TextContent getRights()

setRights

public void setRights(TextContent v)

getIcon

@Deprecated
public java.lang.String getIcon()
Deprecated. Use getIconUri() instead.

Gets icon URI associated with source.

Returns:
icon URI

getIconUri

public java.net.URI getIconUri()
Gets icon URI associated with source.

Returns:
icon URI

setIcon

@Deprecated
public void setIcon(java.lang.String v)
Deprecated. Use setIcon(URI) instead.

Sets icon URI associated with source.

Parameters:
v - icon URI

setIcon

public void setIcon(java.net.URI v)
Sets icon URI associated with source.

Parameters:
v - icon URI

getLogo

@Deprecated
public java.lang.String getLogo()
Deprecated. Use getLogoUri() instead.

Gets logo URI associated with source.

Returns:
logo URI

getLogoUri

public java.net.URI getLogoUri()
Gets logo URI associated with source.

Returns:
logo URI

setLogo

@Deprecated
public void setLogo(java.lang.String v)
Deprecated. Use setLogo(URI) instead.

Sets logo URI associated with source.

Parameters:
v - logo URI

setLogo

public void setLogo(java.net.URI v)
Sets logo URI associated with source.

Parameters:
v - logo URI

getLinks

public java.util.List<Link> getLinks()

addLink

public void addLink(Link v)

addLink

public Link addLink(java.lang.String rel,
                    java.lang.String type,
                    java.lang.String href)

removeLink

public boolean removeLink(Link link)

clearLinks

public void clearLinks()

getAuthors

public java.util.List<Person> getAuthors()

addAuthor

public void addAuthor(Person v)

addAuthors

public void addAuthors(java.util.List<Person> v)

removeAuthor

public boolean removeAuthor(Person v)

clearAuthors

public void clearAuthors()

getContributors

public java.util.List<Person> getContributors()

addContributor

public void addContributor(Person v)

addContributors

public void addContributors(java.util.List<Person> v)

removeContributor

public boolean removeContributor(Person v)

clearContributors

public void clearContributors()

getGenerator

public Source.Generator getGenerator()

setGenerator

public void setGenerator(Source.Generator v)

setGenerator

public Source.Generator setGenerator(java.lang.String version,
                                     java.lang.String uri,
                                     java.lang.String name)

getLink

public Link getLink(java.lang.String rel,
                    java.lang.String type)
Retrieves the first link with the supplied rel and/or type value.

If either parameter is null, doesn't return matches for that parameter.


getLinks

public java.util.List<Link> getLinks(java.lang.String relToMatch,
                                     java.lang.String typeToMatch)
Return the links that match the given rel and type values.

Parameters:
relToMatch - rel value to match or null to match any rel value.
typeToMatch - type value to match or null to match any type value.
Returns:
matching links.

removeLinks

public void removeLinks(java.lang.String relToMatch,
                        java.lang.String typeToMatch)
Remove all links that match the given rel and type values.

Parameters:
relToMatch - rel value to match or null to match any rel value.
typeToMatch - type value to match or null to match any type value.

addHtmlLink

public void addHtmlLink(java.lang.String htmlUrl,
                        java.lang.String lang,
                        java.lang.String title)
Adds a link pointing to an HTML representation.

Parameters:
htmlUrl - link URL
lang - optional language code
title - optional title

getHtmlLink

public Link getHtmlLink()
Retrieves the first HTML link.

Returns:
the link