# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data
Class Source

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.Source

All Implemented Interfaces:
  Extension

Direct Known Subclasses:
  BaseFeed

    public class Source

extends ExtensionPoint

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
`class` `Source.SourceHandler` `<atom:source>` parser.
`protected static class` `Source.SourceState` The SourceState class provides a simple structure that encapsulates the attributes of an Atom source that should be shared with a shallow copy if the entry is adapted to a more specific Source `Kind.Adaptor` subtypes.

Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
`ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler`

Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
`AbstractExtension.AttributesHandler`

Field Summary
`protected Source.SourceState` `srcState` Basic state for this source.

Fields inherited from class com.google.gdata.data.ExtensionPoint
`xmlBlob`

Fields inherited from class com.google.gdata.data.AbstractExtension
`localName, namespace`

Constructor Summary
`` `Source()` Constructs a new `Source` instance with no initial 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 `Source.SourceState`.

Method Summary
`void` `addHtmlLink(java.lang.String htmlUri, java.lang.String lang, java.lang.String title)` Adds a link pointing to an HTML representation.
`void` `addLink(Link link)`
`Link` `addLink(java.lang.String rel, java.lang.String type, java.lang.String href)`
`void` `generateAtom(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)` Generates XML in the Atom format.
`protected void` `generateInnerAtom(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)` Generates inner XML content in the Atom format.
`java.util.List<Person>` `getAuthors()`
`java.util.Set<Category>` `getCategories()`
`java.util.List<Person>` `getContributors()`
`Generator` `getGenerator()`
`Link` `getHtmlLink()` Retrieves the first HTML link.
`java.lang.String` `getIcon()`
`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()`
`TextConstruct` `getRights()`
`TextConstruct` `getSubtitle()`
`TextConstruct` `getTitle()`
`DateTime` `getUpdated()`
`void` `parseAtom(ExtensionProfile extProfile, java.io.InputStream stream)` Parses XML in the Atom format.
`void` `parseAtom(ExtensionProfile extProfile, java.io.Reader reader)` Parses XML in the Atom format.
`void` `removeLinks()` Removes all links.
`void` `removeLinks(java.lang.String relToMatch, java.lang.String typeToMatch)` Remove all links that match the given `rel` and `type` values.
`void` `setGenerator(Generator v)`
`Generator` `setGenerator(java.lang.String version, java.lang.String uri, java.lang.String name)`
`void` `setIcon(java.lang.String v)`
`void` `setId(java.lang.String v)`
`void` `setLogo(java.lang.String v)`
`void` `setRights(TextConstruct v)`
`void` `setSubtitle(TextConstruct v)`
`void` `setTitle(TextConstruct v)`
`void` `setUpdated(DateTime v)`

Methods inherited from class com.google.gdata.data.ExtensionPoint

`addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren`

Methods inherited from class com.google.gdata.data.AbstractExtension
`consumeAttributes, disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### srcState

    protected Source.SourceState srcState

  Basic state for this source. May be shared across multiple adapted instances associated with the same logical source.

Constructor Detail

### Source

    public Source()

  Constructs a new `Source` instance with no initial state.

### 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 `Source.SourceState`.

Method Detail

### 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()

### getTitle

    public TextConstruct getTitle()

### setTitle

    public void setTitle(TextConstruct v)

### getSubtitle

    public TextConstruct getSubtitle()

### setSubtitle

    public void setSubtitle(TextConstruct v)

### getRights

    public TextConstruct getRights()

### setRights

    public void setRights(TextConstruct v)

### getIcon

    public java.lang.String getIcon()

### setIcon

    public void setIcon(java.lang.String v)

### getLogo

    public java.lang.String getLogo()

### setLogo

    public void setLogo(java.lang.String v)

### getLinks

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

### getAuthors

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

### getContributors

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

### getGenerator

    public Generator getGenerator()

### setGenerator

    public void setGenerator(Generator v)

### setGenerator

    public 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.

### addLink

    public void addLink(Link link)

### addLink

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

### 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.

### removeLinks

    public void removeLinks()

  Removes all links.

### addHtmlLink

    public void addHtmlLink(java.lang.String htmlUri,
                            java.lang.String lang,
                            java.lang.String title)

  Adds a link pointing to an HTML representation.

  Parameters:
    `htmlUri` - link URI
    `lang` - optional language code
    `title` - optional title

### getHtmlLink

    public Link getHtmlLink()

  Retrieves the first HTML link.

  Returns:
    the link

### generateAtom

    public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w,
                             ExtensionProfile extProfile)
                      throws java.io.IOException

  Generates XML in the Atom format.

  Parameters:
    `w` - output writer
    `extProfile` - extension profile
  Throws:
    `java.io.IOException`

### generateInnerAtom

    protected void generateInnerAtom(com.google.gdata.util.common.xml.XmlWriter w,
                                     ExtensionProfile extProfile)
                              throws java.io.IOException

  Generates inner XML content in the Atom format.

  Parameters:
    `w` - output writer
    `extProfile` - extension profile
  Throws:
    `java.io.IOException`

### parseAtom

    public void parseAtom(ExtensionProfile extProfile,
                          java.io.InputStream stream)
                   throws java.io.IOException,
                          ParseException

  Parses XML in the Atom format.

  Parameters:
    `extProfile` - extension profile
    `stream` - XML input stream
  Throws:
    `java.io.IOException`
    `ParseException`

### parseAtom

    public void parseAtom(ExtensionProfile extProfile,
                          java.io.Reader reader)
                   throws java.io.IOException,
                          ParseException

  Parses XML in the Atom format.

  Parameters:
    `extProfile` - extension profile
    `reader` - XML Reader. The caller is responsible for ensuring that the character encoding is correct.
  Throws:
    `java.io.IOException`
    `ParseException`