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/12/05 20:25:46 UTC

svn commit: r354135 - /incubator/woden/java/src/org/apache/woden/wsdl20/extensions/

Author: jkaputin
Date: Mon Dec  5 11:25:34 2005
New Revision: 354135

URL: http://svn.apache.org/viewcvs?rev=354135&view=rev
Log:
Javadoc, copyright statement and some minor mods to 
maintain consistency across the extension code.

Modified:
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java
    incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java Mon Dec  5 11:25:34 2005
@@ -1,7 +1,18 @@
-/*
- * (c) Copyright IBM Corp 2001, 2005 
+/**
+ * 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.wsdl20.extensions;
 
 import javax.xml.namespace.QName;
@@ -14,6 +25,8 @@
  * This interface should be implemented by classes which deserialize
  * org.w3c.dom.Elements into extension-specific instances of
  * ExtensibilityElement.
+ * <p>
+ * Copied from WSDL4J.
  *
  * @author Matthew J. Duftler (duftler@us.ibm.com)
  */
@@ -30,16 +43,16 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this element was encountered as an immediate child of
    * a <wsdl:binding> element.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    * @param el the extensibility element to deserialize
    * @param def the definition this extensibility element was
    * encountered in
    * @param extReg the ExtensionRegistry to use (if needed again)
    */
   public ExtensionElement unmarshall(Class parentType,
-                                         QName elementType,
-                                         Element el,
-                                         DescriptionElement desc,
-                                         ExtensionRegistry extReg)
-                                           throws WSDLException;
+                                     QName elementType,
+                                     Element el,
+                                     DescriptionElement desc,
+                                     ExtensionRegistry extReg)
+                                       throws WSDLException;
 }

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java Mon Dec  5 11:25:34 2005
@@ -15,15 +15,27 @@
  */
 package org.apache.woden.wsdl20.extensions;
 
+import javax.xml.namespace.QName;
+
 /**
  * This interface represents WSDL 2.0 extension elements. That is, any XML element
  * information items that appear as [children] of a WSDL 2.0 element and are not in 
  * the WSDL 2.0 namespace (http://www.w3.org/2005/08/wsdl).
+ * <p>
+ * Based on a similar interface from WSDL4J element extensibility.
  * 
  * TODO change this URL if the WSDL 2.0 namespace changes before spec is finalized.
  * 
  * @author jkaputin@apache.org
  */
-public interface ExtensionElement {
-
+public interface ExtensionElement 
+{
+    public void setElementQName(QName qname);
+    
+    public QName getElementQName();
+    
+    public void setRequired(Boolean required);
+    
+    public Boolean getRequired();
+    
 }

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java Mon Dec  5 11:25:34 2005
@@ -56,17 +56,17 @@
 
   /*
     This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
-    and the inner Maps are keyed by (QName)elementType.
+    and the inner Maps are keyed by (QName)elementQN.
   */
   protected Map serializerReg = new Hashtable();
   /*
     This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
-    and the inner Maps are keyed by (QName)elementType.
+    and the inner Maps are keyed by (QName)elementQN.
   */
   protected Map deserializerReg = new Hashtable();
   /*
     This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
-    and the inner Maps are keyed by (QName)elementType.
+    and the inner Maps are keyed by (QName)elementQN.
   */
   protected Map extElementReg = new Hashtable();
   protected ExtensionSerializer defaultSer = null;
@@ -140,7 +140,7 @@
 
   /**
    * Declare that the specified serializer should be used to serialize
-   * all extensibility elements with a qname matching elementType, when
+   * all extensibility elements with a qname matching elementQN, when
    * encountered as children of the specified parentType.
    *
    * @param parentType a class object indicating where in the WSDL
@@ -148,7 +148,7 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this extensibility element was found in the list of
    * extensibility elements belonging to a javax.wsdl.Binding.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    * @param es the extension serializer to use
    *
    * @see #querySerializer(Class, QName)
@@ -171,7 +171,7 @@
 
   /**
    * Declare that the specified deserializer should be used to deserialize
-   * all extensibility elements with a qname matching elementType, when
+   * all extensibility elements with a qname matching elementQN, when
    * encountered as immediate children of the element represented by the
    * specified parentType.
    *
@@ -180,7 +180,7 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this element was encountered as an immediate child of
    * a &lt;wsdl:binding&gt; element.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    * @param ed the extension deserializer to use
    *
    * @see #queryDeserializer(Class, QName)
@@ -203,7 +203,7 @@
 
   /**
    * Look up the serializer to use for the extensibility element with
-   * the qname elementType, which was encountered as a child of the
+   * the qname elementQN, which was encountered as a child of the
    * specified parentType.
    *
    * @param parentType a class object indicating where in the WSDL
@@ -211,7 +211,7 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this extensibility element was found in the list of
    * extensibility elements belonging to a javax.wsdl.Binding.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    *
    * @return the extension serializer, if one was found. If none was
    * found, the behavior depends on the value of the defaultSerializer
@@ -253,7 +253,7 @@
 
   /**
    * Look up the deserializer for the extensibility element with the
-   * qname elementType, which was encountered as an immediate child
+   * qname elementQN, which was encountered as an immediate child
    * of the element represented by the specified parentType.
    *
    * @param parentType a class object indicating where in the WSDL
@@ -261,7 +261,7 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this element was encountered as an immediate child of
    * a &lt;wsdl:binding&gt; element.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    *
    * @return the extension deserializer, if one was found. If none was
    * found, the behavior depends on the value of the defaultDeserializer
@@ -351,7 +351,7 @@
   /**
    * Declare that the specified extensionType is the concrete
    * class which should be used to represent extensibility elements
-   * with qnames matching elementType, that are intended to exist as
+   * with qnames matching elementQN, that are intended to exist as
    * children of the specified parentType.
    *
    * @param parentType a class object indicating where in the WSDL
@@ -360,7 +360,7 @@
    * this extensibility element would be added to the list of
    * extensibility elements belonging to a javax.wsdl.Binding,
    * after being instantiated.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    * @param extensionType the concrete class which should be instantiated
    *
    * @see #createExtElement(Class, QName)
@@ -383,7 +383,7 @@
 
   /**
    * Create an instance of the type which was declared to be used to
-   * represent extensibility elements with qnames matching elementType,
+   * represent extensibility elements with qnames matching elementQN,
    * when intended to exist as children of the specified parentType.
    * This method allows a user to instantiate an extensibility element
    * without having to know the implementing type.
@@ -394,7 +394,7 @@
    * this extensibility element is going to be added to the list of
    * extensibility elements belonging to a javax.wsdl.Binding,
    * after being instantiated.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    *
    * @return a new instance of the type used to represent the
    * specified extension
@@ -436,7 +436,7 @@
       /*
       if (ee.getElementType() == null)
       {
-        ee.setElementType(elementType);
+        ee.setElementType(elementQN);
       }
       */
       

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java Mon Dec  5 11:25:34 2005
@@ -1,7 +1,18 @@
-/*
- * (c) Copyright IBM Corp 2001, 2005 
+/**
+ * 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.wsdl20.extensions;
 
 import java.io.PrintWriter;
@@ -15,6 +26,8 @@
  * This interface should be implemented by classes which serialize
  * extension-specific instances of ExtensibilityElement into the
  * PrintWriter.
+ * <p>
+ * Copied from WSDL4J.
  *
  * @author Matthew J. Duftler (duftler@us.ibm.com)
  */
@@ -29,7 +42,7 @@
    * example, javax.wsdl.Binding.class would be used to indicate
    * this extensibility element was found in the list of
    * extensibility elements belonging to a javax.wsdl.Binding.
-   * @param elementType the qname of the extensibility element
+   * @param elementQN the qname of the extensibility element
    * @param extension the extensibility element to serialize
    * @param def the definition this extensibility element was
    * encountered in

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java Mon Dec  5 11:25:34 2005
@@ -1,7 +1,18 @@
-/*
- * (c) Copyright IBM Corp 2001, 2005 
+/**
+ * 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.wsdl20.extensions;
 
 import javax.xml.namespace.QName;
@@ -15,6 +26,8 @@
 /**
  * This class is used to deserialize arbitrary elements into
  * UnknownExtensionElement instances.
+ * <p>
+ * Copied from WSDL4J.
  *
  * @see UnknownExtensionElement
  * @see UnknownExtensionSerializer
@@ -24,7 +37,7 @@
 public class UnknownExtensionDeserializer implements ExtensionDeserializer
 {
   public ExtensionElement unmarshall(Class parentType,
-                                         QName elementType,
+                                         QName elementQN,
                                          Element el,
                                          DescriptionElement desc,
                                          ExtensionRegistry extReg)
@@ -35,7 +48,7 @@
                                                  Constants.NS_URI_WSDL20,
                                                  Constants.ATTR_REQUIRED);
 
-    unknownExt.setElementType(elementType);
+    unknownExt.setElementQName(elementQN);
 
     if (requiredStr != null)
     {

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java Mon Dec  5 11:25:34 2005
@@ -1,7 +1,18 @@
-/*
- * (c) Copyright IBM Corp 2001, 2005 
+/**
+ * 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.wsdl20.extensions;
 
 import org.w3c.dom.*;
@@ -9,15 +20,18 @@
 
 /**
  * This class is used to wrap arbitrary elements.
+ * <p>
+ * Based on the same class from WSDL4J.
  *
  * @see UnknownExtensionSerializer
  * @see UnknownExtensionDeserializer
  *
  * @author Matthew J. Duftler (duftler@us.ibm.com)
+ * @author jkaputin@apache.org
  */
 public class UnknownExtensionElement implements ExtensionElement
 {
-  protected QName elementType = null;
+  protected QName elementQN = null;
   // Uses the wrapper type so we can tell if it was set or not.
   protected Boolean required = null;
   protected Element element = null;
@@ -25,11 +39,11 @@
   /**
    * Set the type of this extensibility element.
    *
-   * @param elementType the type
+   * @param elementQN the type
    */
-  public void setElementType(QName elementType)
+  public void setElementQName(QName elementQN)
   {
-    this.elementType = elementType;
+    this.elementQN = elementQN;
   }
 
   /**
@@ -37,9 +51,9 @@
    *
    * @return the extensibility element's type
    */
-  public QName getElementType()
+  public QName getElementQName()
   {
-    return elementType;
+    return elementQN;
   }
 
   /**
@@ -84,7 +98,7 @@
   {
     StringBuffer strBuf = new StringBuffer();
 
-    strBuf.append("UnknownExtensionElement (" + elementType + "):");
+    strBuf.append("UnknownExtensionElement (" + elementQN + "):");
     strBuf.append("\nrequired=" + required);
 
     if (element != null)

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java?rev=354135&r1=354134&r2=354135&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java Mon Dec  5 11:25:34 2005
@@ -1,7 +1,18 @@
-/*
- * (c) Copyright IBM Corp 2001, 2005 
+/**
+ * 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.wsdl20.extensions;
 
 import java.io.PrintWriter;
@@ -15,6 +26,8 @@
 /**
  * This class is used to serialize UnknownExtensionElement instances
  * into the PrintWriter.
+ * <p>
+ * Copied from WSDL4J.
  *
  * @see UnknownExtensionElement
  * @see UnknownExtensionDeserializer



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