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/07/07 13:58:15 UTC

svn commit: r209591 - in /incubator/woden/java/src/org/apache/woden: internal/wsdl20/DescriptionImpl.java internal/wsdl20/XMLElementImpl.java wsdl20/xml/DescriptionElement.java wsdl20/xml/DocumentationElement.java wsdl20/xml/XMLElement.java

Author: jkaputin
Date: Thu Jul  7 04:58:14 2005
New Revision: 209591

URL: http://svn.apache.org/viewcvs?rev=209591&view=rev
Log:
Created XMLElement to represent elements like 
<wsdl:documentation>  <xs:element> <xs:complexType>
that need to be parsed but don't need to be represented
explicitly as WSDL API components. Replaced 
DocumentationElement with XMLElement.

Added:
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/XMLElementImpl.java
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/XMLElement.java
Removed:
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/DocumentationElement.java
Modified:
    incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
    incubator/woden/java/src/org/apache/woden/wsdl20/xml/DescriptionElement.java

Modified: incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java?rev=209591&r1=209590&r2=209591&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionImpl.java Thu Jul  7 04:58:14 2005
@@ -17,7 +17,7 @@
 public class DescriptionImpl implements DescriptionElement {
     
     private String fDocumentBaseURI;
-    private DocumentationElement fDocumentationElement;
+    private XMLElement fDocumentationElement;
     private String fTargetNamespace;
     private Map fNamespaces;
     
@@ -67,11 +67,11 @@
         return fNamespaces;
     }
     
-    public void setDocumentationElement(DocumentationElement docEl) {
+    public void setDocumentationElement(XMLElement docEl) {
         this.fDocumentationElement = docEl;
     }
     
-    public DocumentationElement getDocumentationElement() {
+    public XMLElement getDocumentationElement() {
         return this.fDocumentationElement;
     }
     

Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/XMLElementImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/XMLElementImpl.java?rev=209591&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/XMLElementImpl.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/XMLElementImpl.java Thu Jul  7 04:58:14 2005
@@ -0,0 +1,56 @@
+/*
+ * TODO Apache boiler plate
+ */
+package org.apache.woden.internal.wsdl20;
+
+import org.apache.woden.wsdl20.xml.XMLElement;
+
+/**
+ * This class stores XML element information items that needs to be
+ * parsed but are not represented explicitly by the Woden API.
+ * For example, elements such as &lt;wsdl:documentation&gt;, &lt;xs:element&gt;
+ * and &lt;xs:complexType&gt;.
+ * It acts as a container or wrapper for the XML element, treating it as a
+ * java.lang.Object to maintain parser-independence across the Woden API.
+ * Callers will need to cast any java.lang.Objects returned by this class 
+ * to gain access to parser-specific methods (e.g. cast to org.w3.dom.Element
+ * if a DOM parser is being used).
+ * 
+ * @author jkaputin@apache.org
+ */
+public class XMLElementImpl implements XMLElement {
+    
+    String fName;
+    String fNamespace;
+    Object fElement;
+
+    public void setName(String name)
+    {
+        fName = name;
+    }
+    
+    public String getName()
+    {
+        return fName;
+    }
+    
+    public void setNamespace(String namespace)
+    {
+        fNamespace = namespace;
+    }
+    
+    public String getNamespace()
+    {
+        return fNamespace;
+    }
+    
+    public void setElement(Object element)
+    {
+        fElement = element;
+    }
+    
+    public Object getElement()
+    {
+        return fElement;
+    }
+}

Modified: incubator/woden/java/src/org/apache/woden/wsdl20/xml/DescriptionElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/xml/DescriptionElement.java?rev=209591&r1=209590&r2=209591&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/xml/DescriptionElement.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/xml/DescriptionElement.java Thu Jul  7 04:58:14 2005
@@ -25,8 +25,8 @@
     public String getNamespace(String prefix);
     public Map getNamespaces();
     
-    public void setDocumentationElement(DocumentationElement docEl);
-    public DocumentationElement getDocumentationElement();
+    public void setDocumentationElement(XMLElement docEl);
+    public XMLElement getDocumentationElement();
     
     //TODO removeXXX, getXXX methods for the elements with an addXXX method
     

Added: incubator/woden/java/src/org/apache/woden/wsdl20/xml/XMLElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/xml/XMLElement.java?rev=209591&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/xml/XMLElement.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/xml/XMLElement.java Thu Jul  7 04:58:14 2005
@@ -0,0 +1,34 @@
+/*
+ * TODO Apache boiler plate
+ */
+package org.apache.woden.wsdl20.xml;
+
+/**
+ * This interface represents any XML element information item that needs to be
+ * parsed but does not need to be represented explicitly by the Woden API.
+ * For example, elements such as &lt;wsdl:documentation&gt;, &lt;xs:element&gt;
+ * and &lt;xs:complexType&gt; can be represented by this interface.
+ * It acts as a container or wrapper for the XML element, but exposes it in a
+ * parser-independent way by representing the element as a java.lang.Object.
+ * At the XML parsing level implementations will use parser-specific objects, 
+ * such as org.w3.dom.Element, which are then wrapped by this interface. 
+ * Implementors can choose whether to extend this interface in a parser-specific 
+ * way or just let callers  cast any java.lang.Objects returned by this interface 
+ * to gain access to parser-specific  methods.
+ * 
+ * @author jkaputin@apache.org
+ */
+public interface XMLElement {
+    
+    public void setName(String name);
+    
+    public String getName();
+    
+    public void setNamespace(String namespace);
+    
+    public String getNamespace();
+    
+    public void setElement(Object element);
+    
+    public Object getElement();
+}



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