ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkapu...@apache.org
Subject svn commit: r326105 - in /incubator/woden/java/src/org/apache/woden/internal: DOMWSDLReader.java Messages.properties
Date Tue, 18 Oct 2005 13:35:46 GMT
Author: jkaputin
Date: Tue Oct 18 06:35:40 2005
New Revision: 326105

URL: http://svn.apache.org/viewcvs?rev=326105&view=rev
Log:
To parseProperty, modified comments, changed 
textNode.getTextContent to getData to conform to
DOM api and added an error report for QName creation
error. 

Modified:
    incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
    incubator/woden/java/src/org/apache/woden/internal/Messages.properties

Modified: incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java?rev=326105&r1=326104&r2=326105&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java Tue Oct 18 06:35:40
2005
@@ -426,8 +426,34 @@
         return oper;
     }
 
+    /* ******************************************************************
+     * Parse the attributes and child elements of the <property> element.
+     *  
+     * As per WSDL 2.0 spec, they must be in the following order if present:
+     * <documentation>
+     * <value> or <constraint>
+     * extension elements.
+     * 
+     * TODO validate that the elements are in correct order
+     * 
+     * Child elements may include either a <value> or a <constraint>,
+     * but not both. If a <value> element is present, a <constraint> 
+     * may only be present if it contains the NMToken "#value", which
+     * indicates that this <property> specifies a value, not a constraint.
+     * 
+     * TODO validate usage of 'value' and 'constraint' (i.e. in the Validator)
+     * 
+     * This method will parse all child elements of <property> without 
+     * checking for any erroneous use of  <value> and <constraint>.
+     * This will be done later by validation, if it's enabled. 
+     * If the NMToken "#value" is present in a <constraint> element,
+     * this will be flagged with a boolean field in PropertyElement 
+     * and the constraint field will be set to null. 
+     * 
+     */ 
     private PropertyElement parseProperty(Element propEl, 
                                           DescriptionElement desc)
+                                          throws WSDLException
     {
         PropertyElement property = desc.createPropertyElement();
         
@@ -438,16 +464,6 @@
         
         //TODO extension attributes
         
-        /* Parse the child elements of the <property> element. 
-         * As per WSDL 2.0 spec, they must be in the following order if present:
-         * <documentation>
-         * <value> or <constraint>
-         * extension elements.
-         * 
-         * TODO validate that the elements are in correct order
-         * TODO validate that 'value' and 'constraint' are mutually exclusive
-         */ 
-
         Element tempEl = DOMUtils.getFirstChildElement(propEl);
 
         while (tempEl != null)
@@ -471,7 +487,7 @@
                 if(node != null && node instanceof Text)
                 {
                     Text textNode = (Text)node;
-                    String textValue = textNode.getTextContent().trim();
+                    String textValue = textNode.getData().trim();
                     if(textValue.length() > 0)
                     {
                         if(textValue.equals(Constants.TOKEN_VALUE))
@@ -484,11 +500,13 @@
                                 QName qname = DOMUtils.getQName(textValue, tempEl, desc);
                                 property.setConstraint(qname);
                             } catch (WSDLException e) {
-                                //Bad qname, so ignore constraint text and let validator
handle it later.
-                                
-                                //TODO Confirm that validator can handle this later. One
problem might be
-                                //that the context is gone, so the validator cannot tell
if the constraint
-                                //qname was missing or if the qname string had an unbound
prefix.
+                                //Bad qname, so report the error, leave property's constraint

+                                //field null and let validator handle it later.
+                                getErrorReporter().reportError(
+                                        "WSDL504",
+                                        new Object[] {textValue, tempEl.getLocalName()},
+                                        ErrorReporter.SEVERITY_ERROR,
+                                        e);
                             }
                         }
                     }

Modified: incubator/woden/java/src/org/apache/woden/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/Messages.properties?rev=326105&r1=326104&r2=326105&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/Messages.properties (original)
+++ incubator/woden/java/src/org/apache/woden/internal/Messages.properties Tue Oct 18 06:35:40
2005
@@ -59,6 +59,7 @@
 WSDL501=The XML schema imported from "{0}" must specify a target namespace.
 WSDL502=The namespace "{0}" specified on a schema import element does not match the target
namespace "{1}" of the schema at the schemaLocation "{2}".
 WSDL503=An XML schema is missing its target namespace attribute. Schema id is "{0}".
+WSDL504=Problem creating a QName from the string "{0}" in element "{1}".
 
 
 



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


Mime
View raw message