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/11/01 11:32:49 UTC

svn commit: r330019 - in /incubator/woden/java/src/org/apache/woden/internal/wsdl20: ConfigurableImpl.java DocumentableImpl.java

Author: jkaputin
Date: Tue Nov  1 02:32:43 2005
New Revision: 330019

URL: http://svn.apache.org/viewcvs?rev=330019&view=rev
Log:
Two new abstract superclasses that factor out the 
variables and methods for documentation, features
and properties. To avoid lots of copying and pasting.
ConfigurableImpl extends DocumentableImpl. 
WSDL Elements that may contain <documentation> 
<feature> or <property> child elements will
extend ConfigurableImpl. Those that may only contain
<documentation> (but not features or properties) will
extend DocumentableImpl.

Added:
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/ConfigurableImpl.java
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java

Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/ConfigurableImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/ConfigurableImpl.java?rev=330019&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/ConfigurableImpl.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/ConfigurableImpl.java Tue Nov  1 02:32:43 2005
@@ -0,0 +1,98 @@
+/**
+ * Copyright 2005 Apache 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.internal.wsdl20;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.woden.wsdl20.ConfigurableComponent;
+import org.apache.woden.wsdl20.Feature;
+import org.apache.woden.wsdl20.Property;
+import org.apache.woden.wsdl20.xml.ConfigurableElement;
+import org.apache.woden.wsdl20.xml.FeatureElement;
+import org.apache.woden.wsdl20.xml.PropertyElement;
+
+/**
+ * This is an abstract superclass providing support for the
+ * &lt;feature&gt; and &lt;property&gt; elements. 
+ * All WSDL elements that may these as child elements
+ * should inherit this class. 
+ * <p>
+ * Note that in WSDL 2.0, all elements may have documentation, 
+ * so this class extends the DocumentableImpl abstract class.
+ * 
+ * @author jkaputin@apache.org
+ */
+public abstract class ConfigurableImpl extends DocumentableImpl 
+                                       implements ConfigurableComponent,
+                                                  ConfigurableElement 
+{
+    private List fFeatures = new Vector();
+    private List fProperties = new Vector();
+    private List fFeatureElements = new Vector();
+    private List fPropertyElements = new Vector();
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.ConfigurableComponent#getFeatures()
+     */
+    public Feature[] getFeatures() {
+        Feature[] array = new Feature[fFeatures.size()];
+        fFeatures.toArray(array);
+        return array;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.ConfigurableComponent#getProperties()
+     */
+    public Property[] getProperties() {
+        Property[] array = new Property[fProperties.size()];
+        fProperties.toArray(array);
+        return array;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#addFeatureElement(org.apache.woden.wsdl20.xml.FeatureElement)
+     */
+    public void addFeatureElement(FeatureElement feature) {
+        fFeatureElements.add(feature);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#getFeatureElements()
+     */
+    public FeatureElement[] getFeatureElements() {
+        FeatureElement[] array = new FeatureElement[fFeatureElements.size()];
+        fFeatureElements.toArray(array);
+        return array;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#addPropertyElement(org.apache.woden.wsdl20.xml.PropertyElement)
+     */
+    public void addPropertyElement(PropertyElement property) {
+        fPropertyElements.add(property);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.ConfigurableElement#getPropertyElements()
+     */
+    public PropertyElement[] getPropertyElements() {
+        PropertyElement[] array = new PropertyElement[fPropertyElements.size()];
+        fPropertyElements.toArray(array);
+        return array;
+    }
+
+}

Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java?rev=330019&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/DocumentableImpl.java Tue Nov  1 02:32:43 2005
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2005 Apache 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.internal.wsdl20;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.woden.wsdl20.xml.DocumentableElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+
+/**
+ * This is an abstract superclass providing support for the
+ * &lt;documentation&gt; element. All WSDL elements that may
+ * contain &lt;documentation&gt; child elements should inherit 
+ * this class.
+ * 
+ * @author jkaputin@apache.org
+ */
+public abstract class DocumentableImpl implements DocumentableElement {
+
+    private List fDocumentationElements = new Vector();
+    
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.DocumentableElement#addDocumentationElement(org.apache.woden.wsdl20.xml.DocumentationElement)
+     */
+    public void addDocumentationElement(DocumentationElement docEl) {
+        fDocumentationElements.add(docEl);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.xml.DocumentableElement#getDocumentationElements()
+     */
+    public DocumentationElement[] getDocumentationElements() {
+        DocumentationElement[] array = new DocumentationElement[fDocumentationElements.size()];
+        fDocumentationElements.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