public class

ServiceDocument

extends Element
implements IServiceDocument
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.atompub.ServiceDocument

Class Overview

Container for service information.

Summary

Fields
public static final ElementKey<Void, ServiceDocument> KEY The key for this element.
[Expand]
Inherited Fields
From class com.google.gdata.model.Element
Public Constructors
ServiceDocument()
Constructs an instance using the default key.
Protected Constructors
ServiceDocument(ElementKey<?, ? extends ServiceDocument> key)
Subclass constructor, allows subclasses to supply their own element key.
ServiceDocument(ElementKey<?, ? extends ServiceDocument> key, Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance.
Public Methods
Workspace addWorkspace(String title)
Add a new workspace to the service document, returning the newly created workspace to the caller.
ServiceDocument addWorkspace(Workspace workspace)
Adds a new workspace.
void clearWorkspaces()
Removes all existing workspace instances.
List<Workspace> getWorkspaces()
Returns the workspaces.
boolean hasWorkspaces()
Returns whether it has the workspaces.
ServiceDocument lock()
Locks this element.
static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
boolean removeWorkspace(Workspace workspace)
Removes an existing workspace.
[Expand]
Inherited Methods
From class com.google.gdata.model.Element
From class java.lang.Object
From interface com.google.gdata.data.introspection.IServiceDocument

Fields

public static final ElementKey<Void, ServiceDocument> KEY

The key for this element.

Public Constructors

public ServiceDocument ()

Constructs an instance using the default key.

Protected Constructors

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

Subclass constructor, allows subclasses to supply their own element key.

Parameters
key

protected ServiceDocument (ElementKey<?, ? extends ServiceDocument> 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. This constructor is used when adapting from one element key to another. You cannot call this constructor directly, instead use createElement(ElementKey, Element).

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

Public Methods

public Workspace addWorkspace (String title)

Add a new workspace to the service document, returning the newly created workspace to the caller.

Parameters
title

public ServiceDocument addWorkspace (Workspace workspace)

Adds a new workspace.

Parameters
workspace Workspace

public void clearWorkspaces ()

Removes all existing workspace instances.

public List<Workspace> getWorkspaces ()

Returns the workspaces.

Returns
  • workspaces

public boolean hasWorkspaces ()

Returns whether it has the workspaces.

Returns
  • whether it has the workspaces

public ServiceDocument lock ()

Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public boolean removeWorkspace (Workspace workspace)

Removes an existing workspace.

Parameters
workspace Workspace
Returns
  • true if the workspace was removed