Author: jkaputin
Date: Thu Sep 29 10:21:23 2005
New Revision: 292484
URL: http://svn.apache.org/viewcvs?rev=292484&view=rev
Log:
Work in progress on building the component model from
the xml representation. ElementDeclarations in progress.
Modified:
incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionElementImpl.java
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/DOMWSDLReader.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java?rev=292484&r1=292483&r2=292484&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java Thu
Sep 29 10:21:23 2005
@@ -269,6 +269,7 @@
//load the XSModel from the schema string
XSModel xsModel = xsLoader.load(lsInput);
+ //TODO handle a null xsmodel if an error is encountered
schema.setSchemaContent(xsModel);
/*
Modified:
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionElementImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionElementImpl.java?rev=292484&r1=292483&r2=292484&view=diff
==============================================================================
---
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionElementImpl.java
(original)
+++
incubator/woden/java/src/org/apache/woden/internal/wsdl20/DescriptionElementImpl.java
Thu Sep 29 10:21:23 2005
@@ -5,7 +5,16 @@
import java.util.Map;
-import org.apache.woden.wsdl20.xml.*;
+import org.apache.woden.internal.util.ComponentModelBuilder;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.xml.BindingElement;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.ImportElement;
+import org.apache.woden.wsdl20.xml.IncludeElement;
+import org.apache.woden.wsdl20.xml.InterfaceElement;
+import org.apache.woden.wsdl20.xml.ServiceElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
/**
* This class implements support for parsing, creating and manipulating
@@ -29,6 +38,11 @@
private Map fNamespaces;
private TypesElement fTypesElement;
+ //Cache the WSDL component model here, but flush it if any
+ //updates to the XML model happen (e.g. use an Observer)
+ //TODO flush the component model cache if XML updated
+ private Description fDescriptionComponent;
+
public void setDocumentBaseURI(String documentBaseURI)
{
this.fDocumentBaseURI = documentBaseURI;
@@ -46,7 +60,7 @@
public String getTargetNamespace()
{
- return null;
+ return fTargetNamespace;
}
public void addNamespace(String prefix, String namespace)
@@ -126,8 +140,9 @@
fTypesElement = typesEl;
}
- public TypesElement getTypesElement() {
- return null;
+ public TypesElement getTypesElement()
+ {
+ return fTypesElement;
}
public void addInterfaceElement(InterfaceElement interfaceEl)
@@ -135,7 +150,8 @@
}
- public InterfaceElement[] getInterfaces() {
+ public InterfaceElement[] getInterfaces()
+ {
return null;
}
@@ -162,5 +178,23 @@
return null;
}
-
+ /*
+ * Converts the WSDL xml represented within this DescriptionElement
+ * into a WSDL component model represented within a Description
+ * component and returns the Description. For efficiency, the
+ * Description component will be cached, but the cache will be flushed
+ * if any updates to the xml model occur (i.e. the component model must
+ * accurately reflect the underlying xml).
+ *
+ * TODO flush the component model cache if xml is updated
+ */
+ public Description getDescriptionComponent()
+ {
+ if(fDescriptionComponent == null)
+ {
+ ComponentModelBuilder compBuilder = new ComponentModelBuilder();
+ fDescriptionComponent = compBuilder.xmlToComponent(this);
+ }
+ return fDescriptionComponent;
+ }
}
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=292484&r1=292483&r2=292484&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 Sep 29 10:21:23 2005
@@ -3,8 +3,10 @@
*/
package org.apache.woden.internal.wsdl20;
+import java.util.List;
+import java.util.Vector;
+
import org.apache.woden.wsdl20.Binding;
-import org.apache.woden.wsdl20.Component;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.ElementDeclaration;
import org.apache.woden.wsdl20.Interface;
@@ -28,6 +30,12 @@
* @author [EMAIL PROTECTED]
*/
public class DescriptionImpl implements Description {
+
+ private List fInterfaces = new Vector();
+ private List fBindings = new Vector();
+ private List fServices = new Vector();
+ private List fElementDeclarations = new Vector();
+ private List fTypeDefinitions = new Vector();
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.Description#getInterfaces()
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=292484&r1=292483&r2=292484&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 Sep 29 10:21:23 2005
@@ -4,12 +4,18 @@
package org.apache.woden.wsdl20.xml;
import java.util.Map;
+import org.apache.woden.wsdl20.Description;
/**
* This interface represents a <wsdl:description> element.
* It declares the behaviour required to support
* parsing, creating and manipulating a <description> element.
*
+ * TODO initially, have added a method to get the WSDL component
+ * model from the xml instance (i.e. get a Description from this
+ * instance of DescriptionElement). Still need to decide
+ * where on the API to put this. Maybe in WSDLReader?
+ *
* @author [EMAIL PROTECTED]
*/
public interface DescriptionElement extends WSDL20Element
@@ -67,5 +73,18 @@
public ServiceElement[] getServices();
//TODO extension elements
+
+ /*
+ * Component model methods
+ * TODO - where to put this functionality?
+ */
+
+ /* Initially, have added this method here to get the WSDL component
+ * model from the xml instance (i.e. get a Description from this
+ * instance of DescriptionElement). Still need to decide
+ * where on the API to put this. Maybe in WSDLReader?
+ */
+ public Description getDescriptionComponent();
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]