public class

Workspace

extends ExtensionPoint
implements IWorkspace
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.introspection.Workspace

Class Overview

The Workspace class defines the basic Java object model representation and XML parsing/generation support for an AtomPub workspace. The implementation is versioned to support the AtomPub draft version 9 introspection format (used for the GData v1 implementation) as well as the final RFC5023 format (used for all other versions). The key difference between the two is that draft used an attribute for the workspace title where the final version uses an atom:title element. elements.

Summary

Nested Classes
class Workspace.Handler XmlParser ElementHandler for app:workspace  
Fields
private XmlNamespace atomPubNs
private List<Collection> collectionList The list of collections associated with the workspace
private Version coreVersion
private TextConstruct title Title of workspace
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Workspace()
Workspace(TextConstruct title)
Public Methods
void addCollection(Collection coll)
Collection addCollection(String collectionUri, String title, String... acceptedTypes)
Add a new collection to the list of collections associated with this workspace.
void consumeAttributes(AttributeHelper attrHelper)
Consumes attributes from the attribute helper.
void generate(XmlWriter w, ExtensionProfile extProfile)
Generates an XML representation for the extension.
List<Collection> getCollections()
Returns the collections associated with this workspace.
XmlParser.ElementHandler getHandler(ExtensionProfile p, String namespace, String localName, Attributes attrs)
The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.
TextConstruct getTitle()
void processEndElement()
void setTitle(TextConstruct v)
Protected Methods
void visitChildren(ExtensionVisitor ev)
Called to visit all children of this extension point.
[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
From interface com.google.gdata.data.introspection.IWorkspace

Fields

private XmlNamespace atomPubNs

private List<Collection> collectionList

The list of collections associated with the workspace

private Version coreVersion

private TextConstruct title

Title of workspace

Public Constructors

public Workspace ()

public Workspace (TextConstruct title)

Parameters
title

Public Methods

public void addCollection (Collection coll)

Parameters
coll

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

Add a new collection to the list of collections associated with this workspace.

Parameters
collectionUri
title
acceptedTypes

public void consumeAttributes (AttributeHelper attrHelper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
attrHelper Attribute helper

public void generate (XmlWriter w, ExtensionProfile extProfile)

Generates an XML representation for the extension.

Parameters
w XML writer
extProfile Extension profile
Throws
IOException

public List<Collection> getCollections ()

Returns the collections associated with this workspace.

public XmlParser.ElementHandler getHandler (ExtensionProfile p, String namespace, String localName, Attributes attrs)

The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.

Parameters
p Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • an element handler

public TextConstruct getTitle ()

public void processEndElement ()

public void setTitle (TextConstruct v)

Parameters
v

Protected Methods

protected void visitChildren (ExtensionVisitor ev)

Called to visit all children of this extension point.

Parameters
ev The extension visitor.