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/01 02:15:12 UTC

svn commit: r292882 - in /incubator/woden/java/src/org/apache/woden: internal/wsdl20/InterfaceImpl.java wsdl20/Interface.java wsdl20/xml/FaultElement.java wsdl20/xml/InterfaceElement.java wsdl20/xml/OperationElement.java

Author: jkaputin
Date: Fri Sep 30 17:14:59 2005
New Revision: 292882

URL: http://svn.apache.org/viewcvs?rev=292882&view=rev
Log:
Created the Interface component and xml interfaces and 
the implementation class. Also interfaces for <fault> 
and <operation> elements.

Added:
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/FaultElement.java
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/OperationElement.java
Modified:
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java
    incubator/woden/java/src/org/apache/woden/wsdl20/Interface.java
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/InterfaceElement.java

Modified: incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java?rev=292882&r1=292881&r2=292882&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/InterfaceImpl.java Fri Sep 30 17:14:59 2005
@@ -15,6 +15,9 @@
  */
 package org.apache.woden.internal.wsdl20;
 
+import java.util.List;
+import java.util.Vector;
+
 import javax.xml.namespace.QName;
 
 import org.apache.woden.wsdl20.Feature;
@@ -22,7 +25,12 @@
 import org.apache.woden.wsdl20.InterfaceFault;
 import org.apache.woden.wsdl20.InterfaceOperation;
 import org.apache.woden.wsdl20.Property;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.FaultElement;
+import org.apache.woden.wsdl20.xml.FeatureElement;
 import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.OperationElement;
+import org.apache.woden.wsdl20.xml.PropertyElement;
 
 /**
  * This class represents both the Interface component as described in the
@@ -32,55 +40,205 @@
  * 
  * @author jkaputin@apache.org
  */
-public class InterfaceImpl implements Interface, InterfaceElement {
+public class InterfaceImpl implements Interface, InterfaceElement 
+{
+    /*
+     * Interface Element data.
+     */
+    private QName fName = null;
+    private List fExtendsQNames = new Vector();
+    private List fStyleDefaults = new Vector();
+    
+    private DocumentationElement fDocumentation = null;
+    private List fFaultElements = new Vector();
+    private List fOperationElements = new Vector();
+    private List fFeatureElements = new Vector();
+    private List fPropertyElements = new Vector();
+    
+    /*
+     * Interface Component data.
+     * 
+     * These lists represent the properties of the Interface Component, 
+     * cached here to make the 'Interface' 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 List fExtendedInterfaces = new Vector();
+    private List fInterfaceFaults = new Vector();
+    private List fInterfaceOperations = new Vector();
+    private List fFeatures = new Vector();
+    private List fProperties = new Vector();
     
-    QName fName;
 
-    /* (non-Javadoc)
+    /* 
+     * @see org.apache.woden.wsdl20.xml.DocumentableElement#setDocumentationElement(DocumentationElement)
+     */
+    public void setDocumentationElement(DocumentationElement documentation)
+    {
+        fDocumentation = documentation;
+    }
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.DocumentableElement#getDocumentationElement()
+     */
+    public DocumentationElement getDocumentationElement() 
+    {
+        return fDocumentation;
+    }
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#setName(QName)
+     */
+    public void setName(QName qname)
+    {
+        fName = qname;
+    }
+    
+    /* 
      * @see org.apache.woden.wsdl20.Interface#getName()
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getName()
      */
-    public QName getName() {
+    public QName getName() 
+    {
         return fName;
     }
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#addStyleDefault(String)
+     */
+    public void addStyleDefault(String uri)
+    {
+        fStyleDefaults.add(uri);
+    }
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getStyleDefaults()
+     */
+    public String[] getStyleDefaults()
+    {
+        return (String[])fStyleDefaults.toArray();
+    }
 
-    /* (non-Javadoc)
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#addExtendsQName(QName)
+     */
+    public void addExtendsQName(QName qname)
+    {
+        fExtendsQNames.add(qname);
+    }
+    
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getExtendsQNames()
+     */
+    public QName[] getExtendsQNames()
+    {
+        return (QName[])fExtendsQNames.toArray();
+    }
+    
+    /* 
      * @see org.apache.woden.wsdl20.Interface#getExtendedInterfaces()
      */
-    public Interface[] getExtendedInterfaces() {
-        // TODO Auto-generated method stub
-        return null;
+    public Interface[] getExtendedInterfaces() 
+    {
+        return (Interface[])fExtendedInterfaces.toArray();
     }
 
-    /* (non-Javadoc)
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#addFaultElement(FaultElement)
+     */
+    public void addFaultElement(FaultElement fault)
+    {
+        fFaultElements.add(fault);
+    }
+
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getFaultElements()
+     */
+    public FaultElement[] getFaultElements()
+    {
+        return (FaultElement[])fFaultElements.toArray();
+    }
+
+    /* 
      * @see org.apache.woden.wsdl20.Interface#getInterfaceFaults()
      */
-    public InterfaceFault[] getInterfaceFaults() {
-        // TODO Auto-generated method stub
-        return null;
+    public InterfaceFault[] getInterfaceFaults() 
+    {
+        return (InterfaceFault[])fInterfaceFaults.toArray();
+    }
+
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#addOperationElement(OperationElement)
+     */
+    public void addOperationElement(OperationElement operation)
+    {
+        fOperationElements.add(operation);
+    }
+
+    /* 
+     * @see org.apache.woden.wsdl20.xml.InterfaceElement#getOperationElements()
+     */
+    public OperationElement[] getOperationElements()
+    {
+        return (OperationElement[])fOperationElements.toArray();
     }
 
-    /* (non-Javadoc)
+    /* 
      * @see org.apache.woden.wsdl20.Interface#getInterfaceOperations()
      */
-    public InterfaceOperation[] getInterfaceOperations() {
-        // TODO Auto-generated method stub
-        return null;
+    public InterfaceOperation[] getInterfaceOperations() 
+    {
+        return (InterfaceOperation[])fInterfaceOperations.toArray();
     }
 
-    /* (non-Javadoc)
+    /*
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#addFeatureElement(FeatureElement)
+     */
+    public void addFeatureElement(FeatureElement feature)
+    {
+        fFeatureElements.add(feature);
+    }
+    
+    /*
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#getFeatureElements()
+     */
+    public FeatureElement[] getFeatureElements()
+    {
+        return (FeatureElement[])fFeatureElements.toArray();
+    }
+    
+    /* 
      * @see org.apache.woden.wsdl20.ConfigurableComponent#getFeatures()
      */
-    public Feature[] getFeatures() {
-        // TODO Auto-generated method stub
-        return null;
+    public Feature[] getFeatures() 
+    {
+        return (Feature[])fFeatures.toArray();
     }
 
-    /* (non-Javadoc)
+    /*
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#addPropertyElement(PropertyElement)
+     */
+    public void addPropertyElement(PropertyElement property)
+    {
+        fPropertyElements.add(property);
+    }
+    
+    /*
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#getPropertyElements()
+     */
+    public PropertyElement[] getPropertyElements()
+    {
+        return (PropertyElement[])fPropertyElements.toArray();
+    }
+    
+    /* 
      * @see org.apache.woden.wsdl20.ConfigurableComponent#getProperties()
      */
-    public Property[] getProperties() {
-        // TODO Auto-generated method stub
-        return null;
+    public Property[] getProperties() 
+    {
+        return (Property[])fProperties.toArray();
     }
 
 }

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/Interface.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/Interface.java?rev=292882&r1=292881&r2=292882&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/Interface.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/Interface.java Fri Sep 30 17:14:59 2005
@@ -18,6 +18,11 @@
 import javax.xml.namespace.QName;
 
 /**
+ * Represents the Interface component from the WSDL 2.0 Component model.
+ * This component provides a read-only, abstract view of the WSDL 
+ * interface, including any interface information defined within
+ * imported or included WSDL documents. 
+ *
  * @author jkaputin@apache.org
  */
 public interface Interface extends ConfigurableComponent {

Added: incubator/woden/java/src/org/apache/woden/wsdl20/xml/FaultElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/xml/FaultElement.java?rev=292882&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/xml/FaultElement.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/xml/FaultElement.java Fri Sep 30 17:14:59 2005
@@ -0,0 +1,30 @@
+/**
+ * Copyright 2005 Apached Software Foundation 
+ *
+ * Licensed 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.
+ */
+package org.apache.woden.wsdl20.xml;
+
+/**
+ * This interface represents a &lt;fault&gt; XML element 
+ * information item (a child of the &lt.interface&gt. element). 
+ * It declares the behaviour required to support parsing, 
+ * creating and manipulating a &lt;fault&gt; element.
+ * 
+ * @author jkaputin@apache.org
+ */
+public interface FaultElement extends DocumentableElement, 
+                                      ConfigurableElement 
+{
+    //TODO
+}

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/xml/InterfaceElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/xml/InterfaceElement.java?rev=292882&r1=292881&r2=292882&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/xml/InterfaceElement.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/xml/InterfaceElement.java Fri Sep 30 17:14:59 2005
@@ -15,6 +15,8 @@
  */
 package org.apache.woden.wsdl20.xml;
 
+import javax.xml.namespace.QName;
+
 /**
  * This interface represents a &lt;interface&gt; XML element 
  * information item. It declares the behaviour required to support 
@@ -22,6 +24,32 @@
  * 
  * @author jkaputin@apache.org
  */
-public interface InterfaceElement extends WSDL20Element {
+public interface InterfaceElement extends DocumentableElement, 
+                                          ConfigurableElement 
+{
+    /*
+     * Attributes
+     */
+
+    public void setName(QName qname);
+    public QName getName();
+    
+    public void addExtendsQName(QName qname);
+    public QName[] getExtendsQNames();
+    
+    public void addStyleDefault(String uri);
+    public String[] getStyleDefaults();
+    
+    /*
+     * Elements
+     */
+    
+    public void addFaultElement(FaultElement fault);
+    public FaultElement[] getFaultElements();
+    
+    public void addOperationElement(OperationElement operation);
+    public OperationElement[] getOperationElements();
+    
+    //TODO extension elements
 
 }

Added: incubator/woden/java/src/org/apache/woden/wsdl20/xml/OperationElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/xml/OperationElement.java?rev=292882&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/xml/OperationElement.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/xml/OperationElement.java Fri Sep 30 17:14:59 2005
@@ -0,0 +1,30 @@
+/**
+ * Copyright 2005 Apached Software Foundation 
+ *
+ * Licensed 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.
+ */
+package org.apache.woden.wsdl20.xml;
+
+/**
+ * This interface represents an &lt;operation&gt; XML element 
+ * information item (a child of the &lt.interface&gt. element). 
+ * It declares the behaviour required to support parsing, 
+ * creating and manipulating an &lt;operation&gt; element.
+ * 
+ * @author jkaputin@apache.org
+ */
+public interface OperationElement extends DocumentableElement,
+                                          ConfigurableElement 
+{
+    //TODO
+}



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