public class

Workspace

extends Element
implements IWorkspace
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.atompub.Workspace

Class Overview

Server-defined groups of Collections. This is hand-written because it needs versioning support that allows us to hide the title attribute by default.

Summary

Fields
public static final ElementKey<Void, Workspace> KEY The key for this element.
public static final AttributeKey<String> TITLE The title attribute.
[Expand]
Inherited Fields
From class com.google.gdata.model.Element
Public Constructors
Workspace()
Default mutable constructor.
Workspace(TextContent title)
Constructor with the title element.
Protected Constructors
Workspace(ElementKey<?, ? extends Workspace> key)
Lets subclasses create an instance using custom key.
Workspace(ElementKey<?, ? extends Workspace> key, Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance.
Public Methods
Collection addCollection(String collectionUri, String title, String... acceptedTypes)
Add a new collection with the given title and accept types.
void addCollection(Collection collection)
Adds a new collection.
List<Collection> getCollections()
Returns the collections.
TextContent getTitle()
Returns the title.
boolean hasCollections()
Returns whether it has the collections.
boolean hasTitle()
Returns whether it has the title.
static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
boolean removeCollection(Collection collection)
Removes an existing collection.
Element resolve(ElementMetadata<?, ?> meta, ValidationContext vc)
Resolve this element's state against the metadata.
void setTitle(TextContent title)
Sets the title.
String toString()
[Expand]
Inherited Methods
From class com.google.gdata.model.Element
From class java.lang.Object
From interface com.google.gdata.data.introspection.IWorkspace

Fields

public static final ElementKey<Void, Workspace> KEY

The key for this element.

public static final AttributeKey<String> TITLE

The title attribute.

Public Constructors

public Workspace ()

Default mutable constructor.

public Workspace (TextContent title)

Constructor with the title element.

Parameters
title

Protected Constructors

protected Workspace (ElementKey<?, ? extends Workspace> key)

Lets subclasses create an instance using custom key.

Parameters
key

protected Workspace (ElementKey<?, ? extends Workspace> key, Element source)

Constructs a new instance by doing a shallow copy of data from an existing Element instance. Will use the given ElementKey as the key for the element.

Parameters
key The element key to use for this element.
source Source element

Public Methods

public Collection addCollection (String collectionUri, String title, String... acceptedTypes)

Add a new collection with the given title and accept types.

Parameters
collectionUri
title
acceptedTypes

public void addCollection (Collection collection)

Adds a new collection.

Parameters
collection Collection

public List<Collection> getCollections ()

Returns the collections.

Returns
  • collections

public TextContent getTitle ()

Returns the title.

Returns
  • title

public boolean hasCollections ()

Returns whether it has the collections.

Returns
  • whether it has the collections

public boolean hasTitle ()

Returns whether it has the title.

Returns
  • whether it has the title

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public boolean removeCollection (Collection collection)

Removes an existing collection.

Parameters
collection Collection
Returns
  • true if the collection was removed

public Element resolve (ElementMetadata<?, ?> meta, ValidationContext vc)

Resolve this element's state against the metadata. Accumulates errors in caller's validation context.

Parameters
meta
vc Validation context
Returns
  • the narrowed element if narrowing took place.

public void setTitle (TextContent title)

Sets the title.

Parameters
title Title or null to reset

public String toString ()