Author: jkaputin
Date: Wed Nov 23 01:40:26 2005
New Revision: 348402
URL: http://svn.apache.org/viewcvs?rev=348402&view=rev
Log:
Removed setReferenceable() and isReferenceable() from
the Schema interface and made them non-API public
methods of SchemaImpl, because they are used only by
the implementation and this property need not be exposed
on the API. If a schema is 'not referenceable' this will
become apparent (e.g. through an error message) when the
API user attempts to set or retrieve some part of the
wsdl object model that cannot be resolved because the
schema is not referenceable.
Modified:
incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
incubator/woden/java/src/org/apache/woden/internal/schema/SchemaImpl.java
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
incubator/woden/java/src/org/apache/woden/schema/Schema.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=348402&r1=348401&r2=348402&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/DOMWSDLReader.java Wed
Nov 23 01:40:26 2005
@@ -833,10 +833,11 @@
if(schema.getSchemaLocation() == null)
{
//No schema doc to retrieve, importing namespace only.
+
//TODO try to resolve namespace to an existing SchemaReference
- //return schemaImport;
throw new WSDLException(WSDLException.OTHER_ERROR,
"Resolving namespace-only schema import is not supported
yet.");
+ //return schemaImport;
}
//Now try to retrieve the schema import using schemaLocation
@@ -866,7 +867,7 @@
ErrorReporter.SEVERITY_ERROR);
//can't continue schema retrieval with a bad URL.
- schema.setReferenceable(false);
+ ((ImportedSchemaImpl)schema).setReferenceable(false);
return schema;
}
@@ -892,7 +893,7 @@
e4);
//cannot continue without an imported schema
- schema.setReferenceable(false);
+ ((ImportedSchemaImpl)schema).setReferenceable(false);
return schema;
}
Modified:
incubator/woden/java/src/org/apache/woden/internal/schema/SchemaImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/schema/SchemaImpl.java?rev=348402&r1=348401&r2=348402&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/schema/SchemaImpl.java
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/schema/SchemaImpl.java
Wed Nov 23 01:40:26 2005
@@ -61,16 +61,27 @@
return fSchemaDefinition;
}
- /* (non-Javadoc)
- * @see org.apache.woden.schema.Schema#setReferenceable(boolean)
+ /* ************************************************************
+ * Non-API implementation methods
+ * ************************************************************/
+
+ /*
+ * Indicates whether the schema is referenceable by the containing WSDL, as
+ * defined by the WSDL 2.0 spec. In brief, a schema is referenceable if it
is
+ * inlined directly under <.types>. and has a target namespace or if
it is
+ * resolved from a schema import directly under <.types>. and the
import
+ * namespace matches the schema's target namespace.
+ * So for example, when the API is used to retrieve the schema element
+ * declaration identified by a QName attribute, the implementation checks
this
+ * referenceable property to determine which schemas can be used to
resolve the
+ * qname.
+ * Referenceability is determined during validation. If the validation
feature
+ * is disabled, any inlined or imported schema will be considered
referenceable.
*/
public void setReferenceable(boolean referenceable) {
fIsReferenceable = referenceable;
}
- /* (non-Javadoc)
- * @see org.apache.woden.schema.Schema#isReferenceable()
- */
public boolean isReferenceable() {
return fIsReferenceable;
}
Modified:
incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java?rev=348402&r1=348401&r2=348402&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
(original)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/TypesImpl.java
Wed Nov 23 01:40:26 2005
@@ -26,6 +26,7 @@
import javax.xml.namespace.QName;
+import org.apache.woden.internal.schema.SchemaImpl;
import org.apache.woden.schema.Schema;
import org.apache.woden.wsdl20.xml.TypesElement;
import org.apache.ws.commons.schema.XmlSchema;
@@ -210,7 +211,7 @@
Iterator i2 = schemas.iterator();
while(i2.hasNext())
{
- Schema schema = (Schema)i2.next();
+ SchemaImpl schema = (SchemaImpl)i2.next();
if(schema.isReferenceable())
{
refSchemas.add(schema.getSchemaDefinition());
@@ -237,7 +238,7 @@
Iterator i2 = schemas.iterator();
while(i2.hasNext())
{
- Schema schema = (Schema)i2.next();
+ SchemaImpl schema = (SchemaImpl)i2.next();
if(schema.isReferenceable())
{
refSchemaList.add(schema.getSchemaDefinition());
Modified: incubator/woden/java/src/org/apache/woden/schema/Schema.java
URL:
http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/schema/Schema.java?rev=348402&r1=348401&r2=348402&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/schema/Schema.java (original)
+++ incubator/woden/java/src/org/apache/woden/schema/Schema.java Wed Nov 23
01:40:26 2005
@@ -56,18 +56,4 @@
public XmlSchema getSchemaDefinition();
public void setSchemaDefinition(XmlSchema schemaDef);
- /**
- * Indicates whether the schema is referenceable by the containing WSDL, as
- * defined by the WSDL 2.0 spec. In brief, a schema is referenceable if it
is
- * inlined directly under <.types>. and has a target namespace or if
it is
- * resolved from a schema import directly under <.types>. and the
import
- * namespace matches the schema's target namespace.
- * Referenceability will be determined by validation. If the validation
feature
- * is disabled, any inlined or imported schema will be considered
referenceable.
- *
- * @return a boolean indicating whether the referenced schema is
'referenceable'.
- */
- public boolean isReferenceable();
- public void setReferenceable(boolean referenceable);
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]