You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2005/10/29 04:03:02 UTC

svn commit: r329351 - /incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java

Author: jkaputin
Date: Fri Oct 28 19:02:56 2005
New Revision: 329351

URL: http://svn.apache.org/viewcvs?rev=329351&view=rev
Log:
Corrected the getters that return arrays, completed
the remaining method implementations and re-structured
the code.

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

Modified: incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java?rev=329351&r1=329350&r2=329351&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceFaultImpl.java Fri Oct 28 19:02:56 2005
@@ -39,34 +39,22 @@
 public class InterfaceFaultImpl implements InterfaceFault,
                                            InterfaceFaultElement 
 {
+    //WSDL Component model data
     private QName fName = null;
+    private ElementDeclaration fElementDeclaration = null;
+    private List fFeatures = new Vector();
+    private List fProperties = new Vector();
+    private Component fParent = null;
+
+    //XML Element model data
     private QName fElement = null;
     private List fDocumentationElements = new Vector();
     private List fFeatureElements = new Vector();
     private List fPropertyElements = new Vector();
 
-    /*
-     * InterfaceFault Component data.
-     * 
-     * These lists represent the properties of the InterfaceFault Component, 
-     * cached here to make the 'InterfaceFault' methods efficient. 
-     * These properties are exposed on the API as typed arrays, 
-     * but are implemented as Lists for convenience.
-     * 
-     * TODO clear cached component data if xml model is modified
-     */
-    private Component fParent = null;
-    private ElementDeclaration fElementDeclaration = null;
-    private List fFeatures = new Vector();
-    private List fProperties = new Vector();
-    
-    /* 
-     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setName(QName)
-     */
-    public void setName(QName qname)
-    {
-        fName = qname;
-    }
+    /* ************************************************************
+     *  InterfaceMessageReference methods (i.e. WSDL Component model)
+     * ************************************************************/
     
     /*
      * @see org.apache.woden.wsdl20.InterfaceFault#getName()
@@ -77,60 +65,77 @@
         return fName;
     }
 
-    /* 
-     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setElement(QName)
+    /*
+     * @see org.apache.woden.wsdl20.InterfaceFault#getElementDeclaration()
      */
-    public void setElement(QName qname)
+    public ElementDeclaration getElementDeclaration() 
     {
-        fElement = qname;
+        return fElementDeclaration;
     }
     
     /*
-     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElement()
+     * @see org.apache.woden.wsdl20.ConfigurableComponent#getFeatures()
      */
-    public QName getElement() 
+    public Feature[] getFeatures() 
     {
-        return fElement;
+        Feature[] array = new Feature[fFeatures.size()];
+        fFeatures.toArray(array);
+        return array;
     }
 
     /*
-     * @see org.apache.woden.wsdl20.InterfaceFault#getElementDeclaration()
+     * @see org.apache.woden.wsdl20.ConfigurableComponent#getProperties()
      */
-    public ElementDeclaration getElementDeclaration() 
+    public Property[] getProperties() 
     {
-        return fElementDeclaration;
+        Property[] array = new Property[fProperties.size()];
+        fProperties.toArray(array);
+        return array;
     }
 
     /*
-     * Public implementation method (not on API)
+     * @see org.apache.woden.wsdl20.NestedComponent#getParent()
      */
+    public Component getParent() 
+    {
+        return fParent;
+    }
+
+    /* ************************************************************
+     *  Public implementation methods (not on the API)
+     * ************************************************************/
+    
     public void setParent(Component parent) 
     {
         fParent = parent;
     }
-
-    /*
-     * @see org.apache.woden.wsdl20.NestedComponent#getParent()
+    
+    /* ************************************************************
+     *  InterfaceMessageReferenceElement methods (i.e. XML Element model)
+     * ************************************************************/
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setName(QName)
      */
-    public Component getParent() 
+    public void setName(QName qname)
     {
-        return fParent;
+        fName = qname;
     }
-
-    /*
-     * @see org.apache.woden.wsdl20.ConfigurableComponent#getFeatures()
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#setElement(QName)
      */
-    public Feature[] getFeatures() {
-        // TODO Auto-generated method stub
-        return null;
+    public void setElement(QName qname)
+    {
+        fElement = qname;
     }
-
+    
     /*
-     * @see org.apache.woden.wsdl20.ConfigurableComponent#getProperties()
+     * @see org.apache.woden.wsdl20.xml.InterfaceFaultElement#getElement()
      */
-    public Property[] getProperties() {
-        // TODO Auto-generated method stub
-        return null;
+    public QName getElement() 
+    {
+        return fElement;
     }
 
     /*
@@ -146,7 +151,9 @@
      */
     public DocumentationElement[] getDocumentationElements() 
     {
-        return (DocumentationElement[])fDocumentationElements.toArray();
+        DocumentationElement[] array = new DocumentationElement[fDocumentationElements.size()];
+        fDocumentationElements.toArray(array);
+        return array;
     }
     
     /*
@@ -162,7 +169,9 @@
      */
     public FeatureElement[] getFeatureElements() 
     {
-        return (FeatureElement[])fFeatureElements.toArray();
+        FeatureElement[] array = new FeatureElement[fFeatureElements.size()];
+        fFeatureElements.toArray(array);
+        return array;
     }
 
     /*
@@ -178,7 +187,9 @@
      */
     public PropertyElement[] getPropertyElements() 
     {
-        return (PropertyElement[])fPropertyElements.toArray();
+        PropertyElement[] array = new PropertyElement[fPropertyElements.size()];
+        fPropertyElements.toArray(array);
+        return array;
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org