Author: jkaputin
Date: Fri Oct  6 19:15:11 2006
New Revision: 453838

URL: http://svn.apache.org/viewvc?view=rev&rev=453838
Log:
Changed WSDLSource.setSource to throw an 

IllegalArgumentException if the source object 

type is invalid rather than a WSDLException.

Modified the error message and created Javadoc.

Modified:
    incubator/woden/trunk/java/src/org/apache/woden/WSDLSource.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLSource.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLSource.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties

Modified: incubator/woden/trunk/java/src/org/apache/woden/WSDLSource.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/WSDLSource.java?view=diff&rev=453838&r1=453837&r2=453838
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/WSDLSource.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/WSDLSource.java Fri Oct  6 
19:15:11 2006
@@ -54,11 +54,35 @@
  */

 public interface WSDLSource {

     

-    public void setSource(Object wsdlSource) throws WSDLException;

+       /**

+        * Store the specified source object representing the WSDL.

+        * 

+        * @param wsdlSource the WSDL source object

+        * 

+        * @throws IllegalArgumentException if the specified object type is not 

+        * recognized by the WSDLSource implementation. 

+        */

+    public void setSource(Object wsdlSource);

     

+    /**

+     * Returns the implementation specific object representing the WSDL source

+     * (e.g. a DOM Element or Document or an Axiom OMElement). The caller 
should

+     * cast this object to the appropriate type to use its interface.

+     * 

+     * @return the Object representing the WSDL source

+     */

     public Object getSource();

     

+    /**

+     * Store the base URI of the WSDL source document.

+     * 

+     * @param baseURI the URI of the WSDL document.

+     */

     public void setBaseURI(URI baseURI);

     

+    /**

+     * 

+     * @return the base URI of the WSDL

+     */

     public URI getBaseURI();

 }


Modified: 
incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLSource.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLSource.java?view=diff&rev=453838&r1=453837&r2=453838
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLSource.java 
(original)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLSource.java 
Fri Oct  6 19:15:11 2006
@@ -18,7 +18,6 @@
 import java.net.URI;

 

 import org.apache.woden.ErrorReporter;

-import org.apache.woden.WSDLException;

 import org.apache.woden.WSDLSource;

 

 /**

@@ -42,7 +41,7 @@
     /* (non-Javadoc)

      * @see org.apache.woden.WSDLSource#setSource(java.lang.Object)

      */

-    abstract public void setSource(Object wsdlSource) throws WSDLException;

+    abstract public void setSource(Object wsdlSource);

 

     /* (non-Javadoc)

      * @see org.apache.woden.WSDLSource#getSource()


Modified: 
incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLSource.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLSource.java?view=diff&rev=453838&r1=453837&r2=453838
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLSource.java 
(original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLSource.java 
Fri Oct  6 19:15:11 2006
@@ -16,7 +16,6 @@
 package org.apache.woden.internal;

 

 import org.apache.woden.ErrorReporter;

-import org.apache.woden.WSDLException;

 import org.w3c.dom.Document;

 import org.w3c.dom.Element;

 import org.xml.sax.InputSource;

@@ -41,7 +40,7 @@
     /* (non-Javadoc)

      * @see org.apache.woden.WSDLSource#setSource(java.lang.Object)

      */

-    public void setSource(Object wsdlSource) throws WSDLException {

+    public void setSource(Object wsdlSource) {

         

         //TODO check if any other types of wsdl source should be supported

         if(wsdlSource instanceof Element ||

@@ -50,11 +49,13 @@
             fSource = wsdlSource;

         }

         else {

-            String sourceClass = wsdlSource.getClass().getName();

-            String readerClass = "DOMWSDLReader";

+            String sourceClass = (wsdlSource != null

+                                     ? wsdlSource.getClass().getName()

+                                     : null);

+            String wsdlSourceClass = this.getClass().getName();

             String msg = fErrorReporter.getFormattedMessage(

-                    "WSDL017", new Object[] {sourceClass, readerClass});

-            throw new WSDLException(WSDLException.PARSER_ERROR, msg);

+                    "WSDL018", new Object[] {sourceClass, wsdlSourceClass});

+            throw new IllegalArgumentException(msg);

         }

     }

 


Modified: 
incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties?view=diff&rev=453838&r1=453837&r2=453838
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties 
(original)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties 
Fri Oct  6 19:15:11 2006
@@ -50,7 +50,9 @@
 WSDL014=No Extension Registry was set on the DescriptionElement so cannot 
handle the extension element "{0}" in the context of "{1}".

 WSDL015=The extension namespace "{0}" in the context of "{1}" does not have a 
Java class registered.

 WSDL016=The Java class "{0}" does not implement the "ComponentExtensions" 
interface.

-WSDL017=The Java class "{0}" representing the WSDL source is not compatible 
with the WSDLReader implementation class "{1}".

+WSDL017=WSDL source represented by the type "{0}" cannot be read by the 
WSDLReader implementation class "{1}".

+WSDL018=WSDL cannot be represented by the type "{0}" in the WSDLSource 
implementation class "{1}".

+WSDL019=A WSDL element cannot be represented by the type "{0}" in the 
ElementSource implementation class "{1}".

 

 # ------------ Parsing errors -------------------

 




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

Reply via email to