Author: jkaputin
Date: Thu Dec 8 11:16:09 2005
New Revision: 355175
URL: http://svn.apache.org/viewcvs?rev=355175&view=rev
Log:
Added the {system} property to ElementDeclaration and
TypeDefinition components, which stores a URI identifying
the type system (e.g. XML Schema)
Modified:
incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
incubator/woden/java/src/org/apache/woden/internal/wsdl20/ElementDeclarationImpl.java
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
incubator/woden/java/src/org/apache/woden/wsdl20/ElementDeclaration.java
incubator/woden/java/src/org/apache/woden/wsdl20/TypeDefinition.java
Modified:
incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java?rev=355175&r1=355174&r2=355175&view=diff
==============================================================================
---
incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
(original)
+++
incubator/woden/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
Thu Dec 8 11:16:09 2005
@@ -15,6 +15,8 @@
*/
package org.apache.woden.internal.util;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
@@ -68,17 +70,19 @@
//TODO support for other (non-Schema) type systems
private DescriptionImpl fDesc;
+ //TODO private ErrorReporter fErrorRpt; see todo in
buildElementDeclarations()
private List fInScopeSchemas = new Vector();
private List fInterfaces = new Vector();
public ComponentModelBuilder(DescriptionImpl desc)
{
- initComponents(desc);
+ fDesc = desc;
+ //TODO fErrorRpt = errorRpt; see todo in buildElementDeclarations()
+ initComponents();
}
- private void initComponents(DescriptionImpl desc)
+ private void initComponents()
{
- fDesc = desc;
buildElementsAndTypes();
buildInterfaces();
@@ -92,6 +96,22 @@
private void buildElementsAndTypes()
{
TypesElement types = fDesc.getTypesElement();
+
+ URI typeSystemURI = null;
+ try {
+ typeSystemURI = new URI(Constants.TYPE_XSD_2001);
+ } catch (URISyntaxException e) {
+ //TODO this code will propagate 'throws WSDLException' up through
the
+ //method call path to the API getter methods of the Component
model. Try to
+ //find a better way of initializing the Component model without
this
+ //consequence, if possible.
+ //
+ //String msg = fErrorRpt.getFormattedMessage(
+ // "WSDL506",
+ // new Object[]
{Constants.TYPE_XSD_2001});
+ //throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg,
e);
+ }
+
if(types != null)
{
List referenceableSchemaDefs =
((TypesImpl)types).getReferenceableSchemaDefs();
@@ -99,8 +119,8 @@
while(i.hasNext())
{
XmlSchema schemaDef = (XmlSchema)i.next();
- buildElementDeclarations(schemaDef);
- buildTypeDefinitions(schemaDef);
+ buildElementDeclarations(schemaDef, typeSystemURI);
+ buildTypeDefinitions(schemaDef, typeSystemURI);
}
}
}
@@ -108,7 +128,7 @@
/*
* Extract the element declarations from the given schema.
*/
- private void buildElementDeclarations(XmlSchema schemaDef)
+ private void buildElementDeclarations(XmlSchema schemaDef, URI
typeSystemURI)
{
String schemaTns = schemaDef.getTargetNamespace();
if(schemaTns != null)
@@ -123,6 +143,7 @@
{
ElementDeclarationImpl ed = new ElementDeclarationImpl();
ed.setName(qname);
+ ed.setSystem(typeSystemURI);
ed.setContentModel(Constants.API_APACHE_WS_XS);
ed.setContent(elementTable.getItem(qname));
fDesc.addElementDeclaration(ed);
@@ -134,7 +155,7 @@
/*
* Extract the type definitions from the given schema.
*/
- private void buildTypeDefinitions(XmlSchema schemaDef)
+ private void buildTypeDefinitions(XmlSchema schemaDef, URI typeSystemURI)
{
String schemaTns = schemaDef.getTargetNamespace();
if(schemaTns != null)
@@ -149,6 +170,7 @@
{
TypeDefinitionImpl td = new TypeDefinitionImpl();
td.setName(qname);
+ td.setSystem(typeSystemURI);
td.setContentModel(Constants.API_APACHE_WS_XS);
td.setContent(typeTable.getItem(qname));
fDesc.addTypeDefinition(td);
Modified:
incubator/woden/java/src/org/apache/woden/internal/wsdl20/ElementDeclarationImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/ElementDeclarationImpl.java?rev=355175&r1=355174&r2=355175&view=diff
==============================================================================
---
incubator/woden/java/src/org/apache/woden/internal/wsdl20/ElementDeclarationImpl.java
(original)
+++
incubator/woden/java/src/org/apache/woden/internal/wsdl20/ElementDeclarationImpl.java
Thu Dec 8 11:16:09 2005
@@ -15,6 +15,8 @@
*/
package org.apache.woden.internal.wsdl20;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import org.apache.woden.wsdl20.ElementDeclaration;
@@ -28,10 +30,15 @@
*/
public class ElementDeclarationImpl implements ElementDeclaration {
- private QName fName;
- private String fContentModel;
- private Object fContent;
+ private QName fName = null;
+ private URI fSystem = null;
+ private String fContentModel = null;
+ private Object fContent = null;
+ /* ************************************************************
+ * ElementDeclaration interface methods (the WSDL Component model)
+ * ************************************************************/
+
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.ElementDeclaration#getName()
*/
@@ -40,14 +47,14 @@
return fName;
}
- /*
- * Public implementation method (not on API)
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.ElementDeclaration#getSystem()
*/
- public void setName(QName name)
+ public URI getSystem()
{
- fName = name;
+ return fSystem;
}
-
+
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.ElementDeclaration#getContentModel()
*/
@@ -56,14 +63,6 @@
return fContentModel;
}
- /*
- * Public implementation method (not on API)
- */
- public void setContentModel(String contentModel)
- {
- fContentModel = contentModel;
- }
-
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.ElementDeclaration#getContent()
*/
@@ -72,12 +71,29 @@
return fContent;
}
- /*
- * Public implementation method (not on API)
- */
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ public void setName(QName name)
+ {
+ fName = name;
+ }
+
+ public void setSystem(URI typeSystemURI)
+ {
+ fSystem = typeSystemURI;
+ }
+
+ public void setContentModel(String contentModel)
+ {
+ fContentModel = contentModel;
+ }
+
public void setContent(Object elementContent)
{
fContent = elementContent;
}
+
}
Modified:
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java?rev=355175&r1=355174&r2=355175&view=diff
==============================================================================
---
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
(original)
+++
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypeDefinitionImpl.java
Thu Dec 8 11:16:09 2005
@@ -15,6 +15,8 @@
*/
package org.apache.woden.internal.wsdl20;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import org.apache.woden.wsdl20.TypeDefinition;
@@ -28,10 +30,15 @@
*/
public class TypeDefinitionImpl implements TypeDefinition {
- private QName fName;
- private String fContentModel;
- private Object fContent;
+ private QName fName = null;
+ private URI fSystem = null;
+ private String fContentModel = null;
+ private Object fContent = null;
+ /* ************************************************************
+ * TypeDefinition interface methods (the WSDL Component model)
+ * ************************************************************/
+
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.TypeDefinition#getName()
*/
@@ -40,14 +47,14 @@
return fName;
}
- /*
- * Public implementation method (not on API)
+ /* (non-Javadoc)
+ * @see org.apache.woden.wsdl20.TypeDefinition#getSystem()
*/
- public void setName(QName name)
+ public URI getSystem()
{
- fName = name;
+ return fSystem;
}
-
+
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.TypeDefinition#getContentModel()
*/
@@ -56,14 +63,6 @@
return fContentModel;
}
- /*
- * Public implementation method (not on API)
- */
- public void setContentModel(String contentModel)
- {
- fContentModel = contentModel;
- }
-
/* (non-Javadoc)
* @see org.apache.woden.wsdl20.TypeDefinition#getContent()
*/
@@ -72,9 +71,25 @@
return fContent;
}
- /*
- * Public implementation method (not on API)
- */
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ public void setName(QName name)
+ {
+ fName = name;
+ }
+
+ public void setSystem(URI typeSystemURI)
+ {
+ fSystem = typeSystemURI;
+ }
+
+ public void setContentModel(String contentModel)
+ {
+ fContentModel = contentModel;
+ }
+
public void setContent(Object typeDefContent)
{
fContent = typeDefContent;
Modified:
incubator/woden/java/src/org/apache/woden/wsdl20/ElementDeclaration.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/ElementDeclaration.java?rev=355175&r1=355174&r2=355175&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/ElementDeclaration.java
(original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/ElementDeclaration.java
Thu Dec 8 11:16:09 2005
@@ -15,6 +15,8 @@
*/
package org.apache.woden.wsdl20;
+import java.net.URI;
+
import javax.xml.namespace.QName;
/**
@@ -37,15 +39,48 @@
*/
public interface ElementDeclaration {
+ /**
+ * @return the QName identifying this element declaration in the
+ * underlying type system definition.
+ *
+ */
public QName getName();
- /*
- * Indicates the type of model or API used to represent the content.
- * For example, "org.w3c.dom" for a DOM Element or
- * "org.apache.xerces.xs" for an XML Schema API XSElementDeclaration.
+ /**
+ * Indicates the underlying type system of this element declaration.
+ * For example, "http://www.w3.org/2001/XMLSchema" indicates the W3 XML
Schema
+ * type system.
+ *
+ * @return the URI identifying the type system
+ */
+ public URI getSystem();
+
+ /**
+ * Indicates the type of model or API used to represent components from
the
+ * underlying type system identified by the getSystem() method.
+ * <p>
+ * For example:
+ * <ul>
+ * <li>"org.w3c.dom" indicates that the DOM API is used, so the element
declaration
+ * content will be represented by a org.w3c.dom.Element.
+ * <li>"org.apache.ws.commons.schema" indicates that the XmlSchema API
from the
+ * Apache WebServices project is used, so an XmlSchemaElement will
represent the
+ * element declaration content.
+ * </ul>
+ *
+ * @return a String identifying the content model or API used to represent
this
+ * element declaration
*/
public String getContentModel();
+ /**
+ * Returns the content of the element declaration in an object
+ * specific to the underlying content model API. The caller may then
+ * cast this Object to the appropriate type, based on the content model
+ * API indicated by the getContent() method.
+ *
+ * @return the Object representing the content of the element declaration
+ */
public Object getContent();
}
Modified: incubator/woden/java/src/org/apache/woden/wsdl20/TypeDefinition.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/TypeDefinition.java?rev=355175&r1=355174&r2=355175&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/TypeDefinition.java
(original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/TypeDefinition.java Thu
Dec 8 11:16:09 2005
@@ -15,6 +15,8 @@
*/
package org.apache.woden.wsdl20;
+import java.net.URI;
+
import javax.xml.namespace.QName;
/**
@@ -37,15 +39,48 @@
*/
public interface TypeDefinition {
+ /**
+ * @return the QName identifying this type definition in the
+ * underlying type system definition.
+ *
+ */
public QName getName();
- /*
- * Indicates the type of model or API used to represent the content.
- * For example, "org.w3c.dom" for a DOM Element or
- * "org.apache.xerces.xs" for an XML Schema API XSTypeDefinition.
+ /**
+ * Indicates the underlying type system of this type definition.
+ * For example, "http://www.w3.org/2001/XMLSchema" indicates the W3 XML
Schema
+ * type system.
+ *
+ * @return the URI identifying the type system
+ */
+ public URI getSystem();
+
+ /**
+ * Indicates the type of model or API used to represent components from
the
+ * underlying type system identified by the getSystem() method.
+ * <p>
+ * For example:
+ * <ul>
+ * <li>"org.w3c.dom" indicates that the DOM API is used, so the type
definition
+ * content will be represented by a org.w3c.dom.Element.
+ * <li>"org.apache.ws.commons.schema" indicates that the XmlSchema API
from the
+ * Apache WebServices project is used, so an XmlSchemaType will represent
the
+ * type definition content.
+ * </ul>
+ *
+ * @return a String identifying the content model or API used to represent
this
+ * type definition
*/
public String getContentModel();
+ /**
+ * Returns the content of the type definition in an object
+ * specific to the underlying content model API. The caller may then
+ * cast this Object to the appropriate type, based on the content model
+ * API indicated by the getContent() method.
+ *
+ * @return the Object representing the content of the type definition
+ */
public Object getContent();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]