//# 0 errors, 229 messages
//#
/*
    //#Workspace.java:1:1: class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#Workspace.java:1:1: method: org.apache.roller.weblogger.webservices.atomprotocol.Workspace.org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init
* Licensed to the Apache Software Foundation (ASF) under one or more
*  contributor license agreements.  The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.  For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/ 
package org.apache.roller.weblogger.webservices.atomprotocol;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.jdom.Element;


/**
 * This class models an Atom workspace.
 * @author Dave Johnson
 *//*
	appWorkspace =
	   element app:workspace {
   appCommonAttributes,
   ( appCollection*
     & extensionElement* )
	   }
	atomTitle = element atom:title { atomTextConstruct }
 */
public class Workspace {
    private String title = null;
    private String titleType = null; // may be TEXT, HTML, XHTML
    private List collections = new ArrayList(); 
    
    /**
     * Collection MUST have title.
     * @param title    Title for collection
     * @param typeType Content type of title (null for plain text)
     */
    public Workspace(String title, String titleType) {
    //#Workspace.java:48: method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)
    //#input(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this
    //#input(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): title
    //#input(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): titleType
    //#output(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): new ArrayList(Workspace#1) num objects
    //#output(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.collections
    //#output(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.title
    //#output(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.titleType
    //#new obj(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): new ArrayList(Workspace#1)
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.collections == &new ArrayList(Workspace#1)
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.title == title
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): init'ed(this.title)
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): this.titleType == titleType
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): init'ed(this.titleType)
    //#post(void org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)): new ArrayList(Workspace#1) num objects == 1
        this.title = title;
        this.titleType = titleType;
    }
    //#Workspace.java:51: end of method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.org.apache.roller.weblogger.webservices.atomprotocol.Workspace(String, String)
    
    /** Iterate over collections in workspace */
    public List getCollections() {
        return collections;
    //#Workspace.java:55: method: List org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getCollections()
    //#input(List getCollections()): this
    //#input(List getCollections()): this.collections
    //#output(List getCollections()): return_value
    //#pre[2] (List getCollections()): init'ed(this.collections)
    //#post(List getCollections()): return_value == this.collections
    //#post(List getCollections()): init'ed(return_value)
    //#Workspace.java:55: end of method: List org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getCollections()
    }
    
    /** Add new collection to workspace */
    public void addCollection(Collection col) {
        collections.add(col);
    //#Workspace.java:60: method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.addCollection(Collection)
    //#input(void addCollection(Collection)): col
    //#input(void addCollection(Collection)): this
    //#input(void addCollection(Collection)): this.collections
    //#pre[3] (void addCollection(Collection)): this.collections != null
    }
    //#Workspace.java:61: end of method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.addCollection(Collection)
    
    /**
     * DefaultWorkspace must have a human readable title
     */
    public String getTitle() {
        return title;
    //#Workspace.java:67: method: String org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getTitle()
    //#input(String getTitle()): this
    //#input(String getTitle()): this.title
    //#output(String getTitle()): return_value
    //#pre[2] (String getTitle()): init'ed(this.title)
    //#post(String getTitle()): return_value == this.title
    //#post(String getTitle()): init'ed(return_value)
    //#Workspace.java:67: end of method: String org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getTitle()
    }
    
    public void setTitle(String title) {
        this.title = title;
    //#Workspace.java:71: method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.setTitle(String)
    //#input(void setTitle(String)): this
    //#input(void setTitle(String)): title
    //#output(void setTitle(String)): this.title
    //#post(void setTitle(String)): this.title == title
    //#post(void setTitle(String)): init'ed(this.title)
    }
    //#Workspace.java:72: end of method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.setTitle(String)

    public String getTitleType() {
        return titleType;
    //#Workspace.java:75: method: String org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getTitleType()
    //#input(String getTitleType()): this
    //#input(String getTitleType()): this.titleType
    //#output(String getTitleType()): return_value
    //#pre[2] (String getTitleType()): init'ed(this.titleType)
    //#post(String getTitleType()): return_value == this.titleType
    //#post(String getTitleType()): init'ed(return_value)
    //#Workspace.java:75: end of method: String org.apache.roller.weblogger.webservices.atomprotocol.Workspace.getTitleType()
    }

    public void setTitleType(String titleType) {
        this.titleType = titleType;
    //#Workspace.java:79: method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.setTitleType(String)
    //#input(void setTitleType(String)): this
    //#input(void setTitleType(String)): titleType
    //#output(void setTitleType(String)): this.titleType
    //#post(void setTitleType(String)): this.titleType == titleType
    //#post(void setTitleType(String)): init'ed(this.titleType)
    }
    //#Workspace.java:80: end of method: void org.apache.roller.weblogger.webservices.atomprotocol.Workspace.setTitleType(String)
    
    public Collection findCollection(String title, String contentType) {
        for (Iterator it = collections.iterator(); it.hasNext();) {
    //#Workspace.java:83: method: Collection org.apache.roller.weblogger.webservices.atomprotocol.Workspace.findCollection(String, String)
    //#input(Collection findCollection(String, String)): contentType
    //#input(Collection findCollection(String, String)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Collection]
    //#input(Collection findCollection(String, String)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Descendant_Table[others]
    //#input(Collection findCollection(String, String)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.accepts(Ljava/lang/String;)Z
    //#input(Collection findCollection(String, String)): this
    //#input(Collection findCollection(String, String)): this.collections
    //#input(Collection findCollection(String, String)): title
    //#output(Collection findCollection(String, String)): return_value
    //#pre[3] (Collection findCollection(String, String)): this.collections != null
    //#pre[1] (Collection findCollection(String, String)): (soft) contentType != null
    //#presumption(Collection findCollection(String, String)): col.accepts@84 != null
    //#presumption(Collection findCollection(String, String)): java.util.Iterator:next(...).__Tag@84 == org/apache/roller/weblogger/webservices/atomprotocol/Collection
    //#presumption(Collection findCollection(String, String)): java.util.Iterator:next(...)@84 != null
    //#post(Collection findCollection(String, String)): (soft) init'ed(return_value)
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.util.List:size
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.util.List:toArray
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(Collection findCollection(String, String)): Effects-of-calling:java.lang.String:startsWith
    //#test_vector(Collection findCollection(String, String)): title: Addr_Set{null}, Inverse{null}
    //#test_vector(Collection findCollection(String, String)): java.util.Iterator:hasNext(...)@83: {0}, {1}
            Collection col = (Collection) it.next();
            if (title != null && col.accepts(contentType)) {
                return col;
            } else if (col.accepts(contentType)) {
                return col;
            }
        }
        return null;
    //#Workspace.java:91: end of method: Collection org.apache.roller.weblogger.webservices.atomprotocol.Workspace.findCollection(String, String)
    }
        
    /** Deserialize a Atom workspace XML element into an object */
    public static Workspace elementToWorkspace(Element element) {  
        Element titleElem = element.getChild("title", AtomService.ATOM_FORMAT);        
    //#Workspace.java:96: method: Workspace org.apache.roller.weblogger.webservices.atomprotocol.Workspace.elementToWorkspace(Element)
    //#Workspace.java:96: Warning: method not available
    //#    -- call on Element org.jdom.Element:getChild(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: Element org.jdom.Element:getChild(String, Namespace)
    //#input(Workspace elementToWorkspace(Element)): __Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Workspace]
    //#input(Workspace elementToWorkspace(Element)): __Dispatch_Table.addCollection(Lorg/apache/roller/weblogger/webservices/atomprotocol/Collection;)V
    //#input(Workspace elementToWorkspace(Element)): element
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_FORMAT
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_PROTOCOL
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Categories]
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Dispatch_Table.addCategory(Lcom/sun/syndication/feed/atom/Category;)V
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Dispatch_Table.setFixed(Z)V
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Collection]
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.addAccept(Ljava/lang/String;)V
    //#input(Workspace elementToWorkspace(Element)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.addCategories(Lorg/apache/roller/weblogger/webservices/atomprotocol/Categories;)V
    //#output(Workspace elementToWorkspace(Element)): new ArrayList(Workspace#1) num objects
    //#output(Workspace elementToWorkspace(Element)): new Workspace(elementToWorkspace#1) num objects
    //#output(Workspace elementToWorkspace(Element)): return_value.__Tag
    //#output(Workspace elementToWorkspace(Element)): return_value.collections
    //#output(Workspace elementToWorkspace(Element)): return_value.title
    //#output(Workspace elementToWorkspace(Element)): return_value.titleType
    //#output(Workspace elementToWorkspace(Element)): return_value
    //#new obj(Workspace elementToWorkspace(Element)): new ArrayList(Workspace#1)
    //#new obj(Workspace elementToWorkspace(Element)): new Workspace(elementToWorkspace#1)
    //#pre[1] (Workspace elementToWorkspace(Element)): element != null
    //#pre[2] (Workspace elementToWorkspace(Element)): init'ed(org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_FORMAT)
    //#pre[3] (Workspace elementToWorkspace(Element)): init'ed(org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_PROTOCOL)
    //#presumption(Workspace elementToWorkspace(Element)): java.util.Iterator:next(...)@106 != null
    //#presumption(Workspace elementToWorkspace(Element)): org.jdom.Element:getAttribute(...)@100 != null
    //#presumption(Workspace elementToWorkspace(Element)): org.jdom.Element:getChild(...)@96 != null
    //#presumption(Workspace elementToWorkspace(Element)): org.jdom.Element:getChildren(...)@103 != null
    //#post(Workspace elementToWorkspace(Element)): return_value == &new Workspace(elementToWorkspace#1)
    //#post(Workspace elementToWorkspace(Element)): new ArrayList(Workspace#1) num objects == 1
    //#post(Workspace elementToWorkspace(Element)): new Workspace(elementToWorkspace#1) num objects == 1
    //#post(Workspace elementToWorkspace(Element)): return_value.__Tag == org/apache/roller/weblogger/webservices/atomprotocol/Workspace
    //#post(Workspace elementToWorkspace(Element)): return_value.collections == &new ArrayList(Workspace#1)
    //#post(Workspace elementToWorkspace(Element)): init'ed(return_value.title)
    //#post(Workspace elementToWorkspace(Element)): init'ed(return_value.titleType)
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.List:add
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.List:size
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getAttribute
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Attribute:getValue
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getChild
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getText
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getChildren
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getTextTrim
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:com.sun.syndication.feed.atom.Category
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:org.jdom.Element:getAttributeValue
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:com.sun.syndication.feed.atom.Category:setTerm
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:com.sun.syndication.feed.atom.Category:setLabel
    //#unanalyzed(Workspace elementToWorkspace(Element)): Effects-of-calling:com.sun.syndication.feed.atom.Category:setScheme
    //#test_vector(Workspace elementToWorkspace(Element)): java.util.Iterator:hasNext(...)@105: {0}, {1}
    //#test_vector(Workspace elementToWorkspace(Element)): org.jdom.Element:getAttribute(...)@99: Addr_Set{null}, Inverse{null}
        String newTitle = titleElem.getText();
    //#Workspace.java:97: Warning: method not available
    //#    -- call on String org.jdom.Element:getText()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: String org.jdom.Element:getText()
        String newType = null;        
        if (titleElem.getAttribute("type", AtomService.ATOM_FORMAT) != null) {
    //#Workspace.java:99: Warning: method not available
    //#    -- call on Attribute org.jdom.Element:getAttribute(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: Attribute org.jdom.Element:getAttribute(String, Namespace)
            newType = titleElem.getAttribute("type", AtomService.ATOM_FORMAT).getValue();
    //#Workspace.java:100: Warning: method not available
    //#    -- call on Attribute org.jdom.Element:getAttribute(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: Attribute org.jdom.Element:getAttribute(String, Namespace)
    //#Workspace.java:100: Warning: method not available
    //#    -- call on String org.jdom.Attribute:getValue()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: String org.jdom.Attribute:getValue()
        }
        Workspace space = new Workspace(newTitle, newType);
        List collections = element.getChildren("collection", AtomService.ATOM_PROTOCOL);
    //#Workspace.java:103: Warning: method not available
    //#    -- call on List org.jdom.Element:getChildren(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Workspace elementToWorkspace(Element)
    //#    unanalyzed callee: List org.jdom.Element:getChildren(String, Namespace)
        Iterator iter = collections.iterator();
        while (iter.hasNext()) {
            Element e = (Element) iter.next();
            space.addCollection(Collection.elementToCollection(e));
        }
        return space;
    //#Workspace.java:109: end of method: Workspace org.apache.roller.weblogger.webservices.atomprotocol.Workspace.elementToWorkspace(Element)
    }
    
    /**
     * Serialize an AtomService.DefaultWorkspace object into an XML element
     */
    public static Element workspaceToElement(Workspace space) {
        Element element = new Element("workspace", AtomService.ATOM_PROTOCOL);
    //#Workspace.java:116: method: Element org.apache.roller.weblogger.webservices.atomprotocol.Workspace.workspaceToElement(Workspace)
    //#Workspace.java:116: Warning: method not available
    //#    -- call on void org.jdom.Element(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: void org.jdom.Element(String, Namespace)
    //#input(Element workspaceToElement(Workspace)): __Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Workspace]
    //#input(Element workspaceToElement(Workspace)): __Descendant_Table[others]
    //#input(Element workspaceToElement(Workspace)): __Dispatch_Table.getCollections()Ljava/util/List;
    //#input(Element workspaceToElement(Workspace)): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): __Dispatch_Table.getTitleType()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_FORMAT
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_PROTOCOL
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Categories]
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Descendant_Table[others]
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Dispatch_Table.getCategories()Ljava/util/List;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Dispatch_Table.getScheme()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Categories.__Dispatch_Table.isFixed()Z
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Collection]
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Descendant_Table[others]
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.getAccepts()Ljava/util/List;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.getCategories()Ljava/util/List;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.getHref()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.getTitle()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): org/apache/roller/weblogger/webservices/atomprotocol/Collection.__Dispatch_Table.getTitleType()Ljava/lang/String;
    //#input(Element workspaceToElement(Workspace)): space
    //#input(Element workspaceToElement(Workspace)): space.__Tag
    //#input(Element workspaceToElement(Workspace)): space.collections
    //#input(Element workspaceToElement(Workspace)): space.title
    //#input(Element workspaceToElement(Workspace)): space.titleType
    //#output(Element workspaceToElement(Workspace)): new Element(workspaceToElement#1) num objects
    //#output(Element workspaceToElement(Workspace)): return_value
    //#new obj(Element workspaceToElement(Workspace)): new Element(workspaceToElement#1)
    //#pre[1] (Element workspaceToElement(Workspace)): init'ed(org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_FORMAT)
    //#pre[2] (Element workspaceToElement(Workspace)): init'ed(org/apache/roller/weblogger/webservices/atomprotocol/AtomService.ATOM_PROTOCOL)
    //#pre[3] (Element workspaceToElement(Workspace)): space != null
    //#pre[4] (Element workspaceToElement(Workspace)): space.__Tag == org/apache/roller/weblogger/webservices/atomprotocol/Workspace
    //#pre[5] (Element workspaceToElement(Workspace)): space.collections != null
    //#pre[6] (Element workspaceToElement(Workspace)): init'ed(space.title)
    //#pre[7] (Element workspaceToElement(Workspace)): init'ed(space.titleType)
    //#presumption(Element workspaceToElement(Workspace)): col.accepts@127 != null
    //#presumption(Element workspaceToElement(Workspace)): col.categories@127 != null
    //#presumption(Element workspaceToElement(Workspace)): java.util.Iterator:next(...).__Tag@127 == org/apache/roller/weblogger/webservices/atomprotocol/Collection
    //#presumption(Element workspaceToElement(Workspace)): java.util.Iterator:next(...)@127 != null
    //#post(Element workspaceToElement(Workspace)): return_value == &new Element(workspaceToElement#1)
    //#post(Element workspaceToElement(Workspace)): new Element(workspaceToElement#1) num objects == 1
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:org.jdom.Element
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:org.jdom.Element:setAttribute
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:org.jdom.Element:setText
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:org.jdom.Element:addContent
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:com.sun.syndication.feed.atom.Category:getTerm
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:com.sun.syndication.feed.atom.Category:getScheme
    //#unanalyzed(Element workspaceToElement(Workspace)): Effects-of-calling:com.sun.syndication.feed.atom.Category:getLabel
    //#test_vector(Element workspaceToElement(Workspace)): space.titleType: Addr_Set{null}, Inverse{null}
    //#test_vector(Element workspaceToElement(Workspace)): java.lang.String:equals(...)@121: {1}, {0}
    //#test_vector(Element workspaceToElement(Workspace)): java.util.Iterator:hasNext(...)@126: {0}, {1}
        
        Element title = new Element("title", AtomService.ATOM_FORMAT);
    //#Workspace.java:118: Warning: method not available
    //#    -- call on void org.jdom.Element(String, Namespace)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: void org.jdom.Element(String, Namespace)
        title.setText(space.getTitle());
    //#Workspace.java:119: Warning: method not available
    //#    -- call on Element org.jdom.Element:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: Element org.jdom.Element:setText(String)
        element.addContent(title);
    //#Workspace.java:120: Warning: method not available
    //#    -- call on Element org.jdom.Element:addContent(Content)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: Element org.jdom.Element:addContent(Content)
        if (space.getTitleType() != null && !space.getTitleType().equals("TEXT")) {
            title.setAttribute("type", space.getTitleType()); //, AtomService.ATOM_FORMAT);
    //#Workspace.java:122: Warning: method not available
    //#    -- call on Element org.jdom.Element:setAttribute(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: Element org.jdom.Element:setAttribute(String, String)
        }
        
        Iterator iter = space.getCollections().iterator();
        while (iter.hasNext()) {
            Collection col = (Collection) iter.next();
            element.addContent(Collection.collectionToElement(col));
    //#Workspace.java:128: Warning: method not available
    //#    -- call on Element org.jdom.Element:addContent(Content)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
    //#    method: Element workspaceToElement(Workspace)
    //#    unanalyzed callee: Element org.jdom.Element:addContent(Content)
        }
        return element;
    //#Workspace.java:130: end of method: Element org.apache.roller.weblogger.webservices.atomprotocol.Workspace.workspaceToElement(Workspace)
    }

}
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Workspace]
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.addCollection(Lorg/apache/roller/weblogger/webservices/atomprotocol/Collection;)V
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.findCollection(Ljava/lang/String;Ljava/lang/String;)Lorg/apache/roller/weblogger/webservices/atomprotocol/Collection;
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getCollections()Ljava/util/List;
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getTitleType()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.setTitle(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.setTitleType(Ljava/lang/String;)V
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Descendant_Table[org/apache/roller/weblogger/webservices/atomprotocol/Workspace] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.addCollection(Lorg/apache/roller/weblogger/webservices/atomprotocol/Collection;)V == &addCollection
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.findCollection(Ljava/lang/String;Ljava/lang/String;)Lorg/apache/roller/weblogger/webservices/atomprotocol/Collection; == &findCollection
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getCollections()Ljava/util/List; == &getCollections
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getTitle()Ljava/lang/String; == &getTitle
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.getTitleType()Ljava/lang/String; == &getTitleType
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.setTitle(Ljava/lang/String;)V == &setTitle
    //#post(org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init): __Dispatch_Table.setTitleType(Ljava/lang/String;)V == &setTitleType
    //#Workspace.java:: end of method: org.apache.roller.weblogger.webservices.atomprotocol.Workspace.org.apache.roller.weblogger.webservices.atomprotocol.Workspace__static_init
    //#Workspace.java:: end of class: org.apache.roller.weblogger.webservices.atomprotocol.Workspace
