# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.introspection
Class ServiceDocument

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.introspection.ServiceDocument

All Implemented Interfaces:
  Extension, IServiceDocument

    public class ServiceDocument

extends ExtensionPoint
implements IServiceDocument

The ServiceDocument class defines the basic Java object model representation and XML parsing/generation support for an Atom Publishing Protocol introspection document

Nested Class Summary
`class` `ServiceDocument.Handler` XmlParser ElementHandler for `app:service`

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

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

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

Constructor Summary
`ServiceDocument()`

Method Summary
`Workspace` `addWorkspace(java.lang.String title)` Add a new workspace to the service document, returning the newly created workspace to the caller.
`void` `addWorkspace(Workspace workspace)`
`void` `generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)` Generates XML.
`XmlParser.ElementHandler` `getHandler(ExtensionProfile p, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)` The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.
`java.util.List<Workspace>` `getWorkspaces()` Returns the workspaces associated with this service.
`void` `parse(ExtensionProfile extProfile, java.io.InputStream inputStream)` Parses XML from an InputStream.
`void` `parse(ExtensionProfile extProfile, java.io.Reader reader)` Parses XML from a Reader.
`void` `processEndElement()`
`protected void` `visitChildren(ExtensionVisitor ev)` Called to visit all children of this extension point.

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

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

Methods inherited from class com.google.gdata.data.AbstractExtension
`consumeAttributes, disableStrictValidation, enableStrictValidation, eq, 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`

Constructor Detail

### ServiceDocument

    public ServiceDocument()

Method Detail

### getWorkspaces

    public java.util.List<Workspace> getWorkspaces()

  Description copied from interface: `IServiceDocument`
  Returns the workspaces associated with this service.

  Specified by:
    `getWorkspaces` in interface `IServiceDocument`

### addWorkspace

    public void addWorkspace(Workspace workspace)

### addWorkspace

    public Workspace addWorkspace(java.lang.String title)

  Description copied from interface: `IServiceDocument`
  Add a new workspace to the service document, returning the newly created workspace to the caller.

  Specified by:
    `addWorkspace` in interface `IServiceDocument`

### visitChildren

    protected void visitChildren(ExtensionVisitor ev)
                          throws ExtensionVisitor.StoppedException

  Description copied from class: `ExtensionPoint`
  Called to visit all children of this extension point.

  Overrides:
    `visitChildren` in class `ExtensionPoint`
  Parameters:
    `ev` - the extension visitor.
  Throws:
    `ExtensionVisitor.StoppedException`

### generate

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

  Generates XML.

  Specified by:
    `generate` in interface `Extension`
  Overrides:
    `generate` in class `AbstractExtension`
  Parameters:
    `w` - output writer
    `extProfile` - extension profile
  Throws:
    `java.io.IOException`

### parse

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

  Parses XML from a Reader.

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

### parse

    public void parse(ExtensionProfile extProfile,
                      java.io.InputStream inputStream)
               throws java.io.IOException,
                      ParseException

  Parses XML from an InputStream.

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

### getHandler

    public XmlParser.ElementHandler getHandler(ExtensionProfile p,
                                               java.lang.String namespace,
                                               java.lang.String localName,
                                               org.xml.sax.Attributes attrs)

  Description copied from class: `AbstractExtension`
  The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.

  Specified by:
    `getHandler` in interface `Extension`
  Overrides:
    `getHandler` in class `ExtensionPoint`
  Parameters:
    `p` - extension profile
    `namespace` - extension namespace
    `localName` - tag name, without the namespace prefix
    `attrs` - tag attributes
  Returns:
    an element handler

### processEndElement

    public void processEndElement()
                           throws ParseException

  Throws:
    `ParseException`