Author: jkaputin
Date: Thu Jun 30 08:51:37 2005
New Revision: 208641

URL: http://svn.apache.org/viewcvs?rev=208641&view=rev
Log:
Working on methods for description's child elements

Modified:
    
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java

Modified: 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
URL: 
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java?rev=208641&r1=208640&r2=208641&view=diff
==============================================================================
--- 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java 
(original)
+++ 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java 
Thu Jun 30 08:51:37 2005
@@ -3,52 +3,145 @@
  */

 package org.apache.woden.internal.wsdl20;

 

-import org.apache.woden.wsdl20.Binding;

-import org.apache.woden.wsdl20.Interface;

-import org.apache.woden.wsdl20.Service;

+import java.util.Map;

+

+import org.apache.woden.wsdl20.xml.BindingElement;

 import org.apache.woden.wsdl20.xml.DescriptionElement;

-import org.apache.woden.wsdl20.xml.ElementDeclaration;

-import org.apache.woden.wsdl20.xml.TypeDefinition;

+import org.apache.woden.wsdl20.xml.ImportElement;

+import org.apache.woden.wsdl20.xml.IncludeElement;

+import org.apache.woden.wsdl20.xml.InterfaceElement;

+import org.apache.woden.wsdl20.xml.ServiceElement;

+import org.apache.woden.wsdl20.xml.TypesElement;

+import org.w3c.dom.Element;

 

 /**

+ * This class implements support for parsing, creating and manipulating 

+ * a WSDL <description> element. It reflects the XML Infoset element

+ * information item for a <description> element.

+ * 

  * @author [EMAIL PROTECTED]

  */

 public class DescriptionImpl implements DescriptionElement {

     

+    private String fDocumentBaseURI;

+    private Element fDocumentationElement;

     private String fTargetNamespace;

+    private Map fNamespaces;

     

-    public void addInterface(Interface iFace) {

-        //TODO determine if both an adder and a setter are required, or just 
one

+    public void setDocumentBaseURI(String documentBaseURI) {

+        this.fDocumentBaseURI = documentBaseURI;

     }

     

-    public void setInterfaces(Interface[] iFaces) {

+    public String getDocumentBaseURI() {

+        return this.fDocumentBaseURI;

     }

     

-    public Interface[] getInterfaces() {

-        return null;    

+    public void setTargetNamespace(String namespace) {

+        this.fTargetNamespace = namespace;    

     }

     

-    public Binding[] getBindings() {

+    public String getTargetNamespace() {

         return null;    

     }

+

+    public void addNamespace(String prefix, String namespace) {

+        //ignores duplicate prefixes in the WSDL - earlier namespace gets 
overwritten.

+        

+        String pfx = (prefix != null) ? prefix : "";

+        

+        //null namespace value deletes the namespace

+        if (namespace != null) {

+            fNamespaces.put(pfx,namespace);

+        } else {

+            this.removeNamespace(pfx);

+        }

+    }

     

-    public Service[] getServices() {

-        return null;    

+    //TODO - consider the convention where removeXXX returns the removed object

+    public void removeNamespace(String prefix) {

+        

+        String pfx = (prefix != null) ? prefix : "";

+        fNamespaces.remove(pfx);

     }

     

-    public ElementDeclaration[] getElementDeclarations() {

-        return null;    

+    public String getNamespace(String prefix) {

+        

+        String pfx = (prefix != null) ? prefix : "";

+        return (String) fNamespaces.get(pfx);

     }

     

-    public TypeDefinition[] getTypeDefinitions() {

-        return null;    

+    public Map getNamespaces() {

+        return fNamespaces;

+    }

+    

+    public void setDocumentationElement(Element docEl) {

+        this.fDocumentationElement = docEl;

+    }

+    

+    public Element getDocumentationElement() {

+        return this.fDocumentationElement;

+    }

+    

+    public void addImportElement(ImportElement importEl)

+    {

+        

     }

 

-    public String getTargetNamespace() {

+    public ImportElement[] getImports()

+    {

+        return null;

+    }

+    

+    public void addIncludeElement(IncludeElement includeEl)

+    {

+        

+    }

+

+    public IncludeElement[] getIncludes()

+    {

+        return null;

+    }

+

+    public void addTypesElement(TypesElement typesEl)

+    {

+        

+    }

+

+    public TypesElement[] getTypes() {

         return null;    

     }

 

-    public void setTargetNamespace(String namespace) {

-        this.fTargetNamespace = namespace;    

+    public void addInterfaceElement(InterfaceElement interfaceEl) 

+    {

+        

+    }

+    

+    public InterfaceElement[] getInterfaces() {

+        return null;    

+    }

+    

+    public void setInterfaces(InterfaceElement[] interfaces) {

+    }

+    

+    public void addBindingElement(BindingElement bindingEl)

+    {

+        

+    }

+    

+    public BindingElement[] getBindings() 

+    {

+        return null;    

+    }

+    

+    public void addServiceElement(ServiceElement serviceEl)

+    {

+        

     }

+    

+    public ServiceElement[] getServices() 

+    {

+        return null;    

+    }

+    

+    

 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to