Author: jkaputin
Date: Tue Nov  8 04:34:38 2005
New Revision: 331798

URL: http://svn.apache.org/viewcvs?rev=331798&view=rev
Log:
Implemented the new API method getElementDeclaration(qname).

Also removed the collections for Interface, Binding

and Service components. Instead we just maintain 

collections of InterfaceElement, BindingElement and

ServiceElement and cast appropriately to implement the

getter methods for the Component model (i.e. each Impl

class implements the related Component and Element

interfaces).

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=331798&r1=331797&r2=331798&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 
Tue Nov  8 04:34:38 2005
@@ -68,9 +68,6 @@
     /*

      * WSDL Component model data

      */

-    private List fInterfaces = new Vector();

-    private List fBindings = new Vector();

-    private List fServices = new Vector();

     private List fElementDeclarations = new Vector(); //TODO consider using Map

     private List fTypeDefinitions = new Vector(); //TODO consider using Map

     

@@ -78,9 +75,11 @@
      * XML Element model data

      */

     private URI fDocumentBaseURI = null;

+

     //<description> attributes

     private URI fTargetNamespace = null;

     private Map fNamespaces = new HashMap();

+

     //<description> child elements

     private List fImportElements = new Vector();

     private List fIncludeElements = new Vector();

@@ -106,8 +105,8 @@
     public Interface[] getInterfaces() 

     {

         if(!fComponentsInitialized) initComponents();

-        Interface[] array = new Interface[fInterfaces.size()];

-        fInterfaces.toArray(array);

+        Interface[] array = new Interface[fInterfaceElements.size()];

+        fInterfaceElements.toArray(array);

         return array;

     }

 

@@ -117,8 +116,8 @@
     public Binding[] getBindings() 

     {

         if(!fComponentsInitialized) initComponents();

-        Binding[] array = new Binding[fBindings.size()];

-        fBindings.toArray(array);

+        Binding[] array = new Binding[fBindingElements.size()];

+        fBindingElements.toArray(array);

         return array;

     }

 

@@ -128,8 +127,8 @@
     public Service[] getServices() 

     {

         if(!fComponentsInitialized) initComponents();

-        Service[] array = new Service[fServices.size()];

-        fServices.toArray(array);

+        Service[] array = new Service[fServiceElements.size()];

+        fServiceElements.toArray(array);

         return array;

     }

 

@@ -142,6 +141,25 @@
         ElementDeclaration[] array = new 
ElementDeclaration[fElementDeclarations.size()];

         fElementDeclarations.toArray(array);

         return array;

+    }

+    

+    /* (non-Javadoc)

+     * @see 
org.apache.woden.wsdl20.Description#getElementDeclaration(javax.xml.namespace.QName)

+     * TODO consider using Map instead of List

+     */

+    public ElementDeclaration getElementDeclaration(QName qname)

+    {

+        ElementDeclaration elDec = null;

+        Iterator i = fElementDeclarations.iterator();

+        while(i.hasNext())

+        {

+            ElementDeclaration ed = (ElementDeclaration)i.next();

+            if(qname.equals(ed.getName())) 

+            {

+                elDec = ed;

+            }

+        }

+        return elDec;

     }

     

     /* (non-Javadoc)




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

Reply via email to