You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by bi...@apache.org on 2009/01/07 20:07:49 UTC
svn commit: r732433 - in
/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema:
SchemaBuilder.java XmlSchemaNotation.java XmlSchemaObject.java
utils/XmlSchemaNamed.java utils/XmlSchemaObjectBase.java
Author: bimargulies
Date: Wed Jan 7 11:07:48 2009
New Revision: 732433
URL: http://svn.apache.org/viewvc?rev=732433&view=rev
Log:
Notations.
Added:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java (with props)
Modified:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaNotation.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaObject.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamed.java
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java?rev=732433&r1=732432&r2=732433&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/SchemaBuilder.java Wed Jan 7 11:07:48 2009
@@ -883,7 +883,7 @@
XmlSchemaRedefine redefine = handleRedefine(currentSchema, el, schemaEl);
currentSchema.includes.add(redefine);
} else if (el.getLocalName().equals("notation")) {
- XmlSchemaNotation notation = handleNotation(el);
+ XmlSchemaNotation notation = handleNotation(currentSchema, el);
currentSchema.notations.
collection.put(new QName(currentSchema.getTargetNamespace(), notation.name),
notation);
@@ -1575,9 +1575,9 @@
return group;
}
- private XmlSchemaNotation handleNotation(Element notationEl) {
+ private XmlSchemaNotation handleNotation(XmlSchema schema, Element notationEl) {
- XmlSchemaNotation notation = new XmlSchemaNotation();
+ XmlSchemaNotation notation = new XmlSchemaNotation(schema);
if (notationEl.hasAttribute("id")) {
notation.setId(notationEl.getAttribute("id"));
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaNotation.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaNotation.java?rev=732433&r1=732432&r2=732433&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaNotation.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaNotation.java Wed Jan 7 11:07:48 2009
@@ -19,22 +19,29 @@
package org.apache.ws.commons.schema;
+import javax.xml.namespace.QName;
+
+import org.apache.ws.commons.schema.utils.XmlSchemaNamed;
+import org.apache.ws.commons.schema.utils.XmlSchemaNamedImpl;
+
/**
* Class represents a notation. An XML Schema definition language (XSD) notation declaration is a
* reconstruction of XML 1.0 NOTATION declarations. The purpose of notations is to describe the format of
* non-XML data within an XML document. Represents the World Wide Web Consortium (W3C) notation element.
*/
-public class XmlSchemaNotation extends XmlSchemaAnnotated {
+public class XmlSchemaNotation extends XmlSchemaAnnotated implements XmlSchemaNamed {
String name;
String system;
String publicNotation;
+ private XmlSchemaNamedImpl namedDelegate;
/**
* Creates new XmlSchemaNotation
*/
- public XmlSchemaNotation() {
+ public XmlSchemaNotation(XmlSchema parent) {
+ namedDelegate = new XmlSchemaNamedImpl(parent, true);
}
public String getName() {
@@ -61,4 +68,24 @@
this.system = system;
}
+ public XmlSchema getParent() {
+ return namedDelegate.getParent();
+ }
+
+ public QName getQName() {
+ return namedDelegate.getQName();
+ }
+
+ public boolean isAnonymous() {
+ return namedDelegate.isAnonymous();
+ }
+
+ public boolean isTopLevel() {
+ return namedDelegate.isTopLevel();
+ }
+
+ public String toString() {
+ return namedDelegate.toString();
+ }
+
}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaObject.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaObject.java?rev=732433&r1=732432&r2=732433&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaObject.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaObject.java Wed Jan 7 11:07:48 2009
@@ -22,7 +22,9 @@
import java.util.LinkedHashMap;
import java.util.Map;
-public abstract class XmlSchemaObject {
+import org.apache.ws.commons.schema.utils.XmlSchemaObjectBase;
+
+public abstract class XmlSchemaObject implements XmlSchemaObjectBase {
int lineNumber;
int linePosition;
String sourceURI;
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamed.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamed.java?rev=732433&r1=732432&r2=732433&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamed.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaNamed.java Wed Jan 7 11:07:48 2009
@@ -28,7 +28,7 @@
* name is <i>not</i> the on-the-wire name for attributes and elements. Those
* names depend on the form, and are managed by {@link XmlSchemaNamedWithForm}.
*/
-public interface XmlSchemaNamed {
+public interface XmlSchemaNamed extends XmlSchemaObjectBase {
/**
* Retrieve the name.
Added: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java?rev=732433&view=auto
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java (added)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java Wed Jan 7 11:07:48 2009
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ws.commons.schema.utils;
+
+/**
+ * This interface exists to tie the type hierarchy of things like XmlSchemaNamed
+ * to the main type hierarchy of XmlSchemaObject. An interface like XmlSchemaNamed can
+ * have an 'isa' relationship to another interface, but not to a class.
+ */
+public interface XmlSchemaObjectBase {
+}
Propchange: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/utils/XmlSchemaObjectBase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date