public class

Source

extends ExtensionPoint
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.Source
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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*)
   }
 

Summary

Nested Classes
class Source.SourceHandler <atom:source> parser. 
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. 
Fields
protected Source.SourceState srcState Basic state for this source.
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Source()
Constructs a new Source instance with no initial state.
Protected Constructors
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.
Public Methods
void addHtmlLink(String htmlUri, String lang, String title)
Adds a link pointing to an HTML representation.
Link addLink(String rel, String type, String href)
void addLink(Link link)
void generateAtom(XmlWriter w, ExtensionProfile extProfile)
Generates XML in the Atom format.
List<Person> getAuthors()
Set<Category> getCategories()
List<Person> getContributors()
Generator getGenerator()
Link getHtmlLink()
Retrieves the first HTML link.
String getIcon()
String getId()
Link getLink(String rel, String type)
Retrieves the first link with the supplied rel and/or type value.
List<Link> getLinks()
List<Link> getLinks(String relToMatch, String typeToMatch)
Return the links that match the given rel and type values.
String getLogo()
TextConstruct getRights()
TextConstruct getSubtitle()
TextConstruct getTitle()
DateTime getUpdated()
void parseAtom(ExtensionProfile extProfile, InputStream stream)
Parses XML in the Atom format.
void parseAtom(ExtensionProfile extProfile, Reader reader)
Parses XML in the Atom format.
void removeLinks(String relToMatch, String typeToMatch)
Remove all links that match the given rel and type values.
void removeLinks()
Removes all links.
void setGenerator(Generator v)
Generator setGenerator(String version, String uri, String name)
void setIcon(String v)
void setId(String v)
void setLogo(String v)
void setRights(TextConstruct v)
void setSubtitle(TextConstruct v)
void setTitle(TextConstruct v)
void setUpdated(DateTime v)
Protected Methods
void generateInnerAtom(XmlWriter w, ExtensionProfile extProfile)
Generates inner XML content in the Atom format.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Fields

protected Source.SourceState srcState

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

Public Constructors

public Source ()

Constructs a new Source instance with no initial state.

Protected Constructors

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.

Parameters
sourceSource

Public Methods

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

Adds a link pointing to an HTML representation.

Parameters
htmlUri Link URI
lang Optional language code
title Optional title

public Link addLink (String rel, String type, String href)

Parameters
rel
type
href

public void addLink (Link link)

Parameters
link

public void generateAtom (XmlWriter w, ExtensionProfile extProfile)

Generates XML in the Atom format.

Parameters
w Output writer
extProfile Extension profile
Throws
IOException

public List<Person> getAuthors ()

public Set<Category> getCategories ()

public List<Person> getContributors ()

public Generator getGenerator ()

public Link getHtmlLink ()

Retrieves the first HTML link.

Returns
  • the link

public String getIcon ()

public String getId ()

public Link getLink (String rel, 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.

Parameters
rel
type

public List<Link> getLinks ()

public List<Link> getLinks (String relToMatch, 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.

public String getLogo ()

public TextConstruct getRights ()

public TextConstruct getSubtitle ()

public TextConstruct getTitle ()

public DateTime getUpdated ()

public void parseAtom (ExtensionProfile extProfile, InputStream stream)

Parses XML in the Atom format.

Parameters
extProfile Extension profile
stream XML input stream
Throws
ParseException
IOException

public void parseAtom (ExtensionProfile extProfile, Reader reader)

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
IOException
ParseException

public void removeLinks (String relToMatch, 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.

public void removeLinks ()

Removes all links.

public void setGenerator (Generator v)

Parameters
v

public Generator setGenerator (String version, String uri, String name)

Parameters
version
uri
name

public void setIcon (String v)

Parameters
v

public void setId (String v)

Parameters
v

public void setLogo (String v)

Parameters
v

public void setRights (TextConstruct v)

Parameters
v

public void setSubtitle (TextConstruct v)

Parameters
v

public void setTitle (TextConstruct v)

Parameters
v

public void setUpdated (DateTime v)

Parameters
v

Protected Methods

protected void generateInnerAtom (XmlWriter w, ExtensionProfile extProfile)

Generates inner XML content in the Atom format.

Parameters
w Output writer
extProfile Extension profile
Throws
IOException