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 21:12:23 UTC

svn commit: r732461 - in /webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema: SchemaBuilder.java XmlSchemaAttributeGroup.java XmlSchemaGroup.java XmlSchemaNotation.java XmlSchemaSerializer.java XmlSchemaType.java

Author: bimargulies
Date: Wed Jan  7 12:12:22 2009
New Revision: 732461

URL: http://svn.apache.org/viewvc?rev=732461&view=rev
Log:
Make more things private instead of default.

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/XmlSchemaAttributeGroup.java
    webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.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/XmlSchemaSerializer.java
    webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.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=732461&r1=732460&r2=732461&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 12:12:22 2009
@@ -878,8 +878,7 @@
         } else if (el.getLocalName().equals("notation")) {
             XmlSchemaNotation notation = handleNotation(currentSchema, el);
             currentSchema.notations.
-                collection.put(new QName(currentSchema.getTargetNamespace(), notation.name),
-                                            notation);
+                collection.put(notation.getQName(), notation);
             currentSchema.items.add(notation);
         } else if (el.getLocalName().equals("annotation")) {
             XmlSchemaAnnotation annotation = handleAnnotation(el);
@@ -1276,12 +1275,12 @@
 
             if (el.getLocalName().equals("attribute")) {
                 XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
-                attrGroup.attributes.add(attr);
+                attrGroup.getAttributes().add(attr);
             } else if (el.getLocalName().equals("attributeGroup")) {
                 XmlSchemaAttributeGroupRef attrGroupRef = handleAttributeGroupRef(el);
-                attrGroup.attributes.add(attrGroupRef);
+                attrGroup.getAttributes().add(attrGroupRef);
             } else if (el.getLocalName().equals("anyAttribute")) {
-                attrGroup.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
+                attrGroup.setAnyAttribute(handleAnyAttribute(schema, el, schemaEl));
             } else if (el.getLocalName().equals("annotation")) {
                 XmlSchemaAnnotation ann = handleAnnotation(el);
                 attrGroup.setAnnotation(ann);
@@ -1520,11 +1519,11 @@
              el = XDOMUtil.getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
 
             if (el.getLocalName().equals("all")) {
-                group.particle = handleAll(schema, el, schemaEl);
+                group.setParticle(handleAll(schema, el, schemaEl));
             } else if (el.getLocalName().equals("sequence")) {
-                group.particle = handleSequence(schema, el, schemaEl);
+                group.setParticle(handleSequence(schema, el, schemaEl));
             } else if (el.getLocalName().equals("choice")) {
-                group.particle = handleChoice(schema, el, schemaEl);
+                group.setParticle(handleChoice(schema, el, schemaEl));
             } else if (el.getLocalName().equals("annotation")) {
                 XmlSchemaAnnotation groupAnnotation = handleAnnotation(el);
                 group.setAnnotation(groupAnnotation);
@@ -1577,15 +1576,15 @@
         }
 
         if (notationEl.hasAttribute("name")) {
-            notation.name = notationEl.getAttribute("name");
+            notation.setName(notationEl.getAttribute("name"));
         }
 
         if (notationEl.hasAttribute("public")) {
-            notation.publicNotation = notationEl.getAttribute("public");
+            notation.setPublicNotation(notationEl.getAttribute("public"));
         }
 
         if (notationEl.hasAttribute("system")) {
-            notation.system = notationEl.getAttribute("system");
+            notation.setSystem(notationEl.getAttribute("system"));
         }
 
         Element annotationEl = XDOMUtil.getFirstChildElementNS(notationEl, XmlSchema.SCHEMA_NS, "annotation");

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaAttributeGroup.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaAttributeGroup.java?rev=732461&r1=732460&r2=732461&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaAttributeGroup.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaAttributeGroup.java Wed Jan  7 12:12:22 2009
@@ -33,9 +33,9 @@
  */
 
 public class XmlSchemaAttributeGroup extends XmlSchemaAnnotated implements XmlSchemaNamed {
-    XmlSchemaAnyAttribute anyAttribute;
-    XmlSchemaObjectCollection attributes;
-    XmlSchemaNamedImpl namedDelegate;
+    private XmlSchemaAnyAttribute anyAttribute;
+    private XmlSchemaObjectCollection attributes;
+    private XmlSchemaNamedImpl namedDelegate;
 
     /**
      * Creates new XmlSchemaAttributeGroup

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.java?rev=732461&r1=732460&r2=732461&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaGroup.java Wed Jan  7 12:12:22 2009
@@ -34,7 +34,7 @@
 public class XmlSchemaGroup extends XmlSchemaAnnotated implements XmlSchemaNamed {
 
 
-    XmlSchemaGroupBase particle;
+    private XmlSchemaGroupBase particle;
     private XmlSchemaNamedImpl namedDelegate;
     
     public XmlSchemaGroup(XmlSchema parent) {

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=732461&r1=732460&r2=732461&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 12:12:22 2009
@@ -32,9 +32,8 @@
 
 public class XmlSchemaNotation extends XmlSchemaAnnotated implements XmlSchemaNamed {
 
-    String name;
-    String system;
-    String publicNotation;
+    private String system;
+    private String publicNotation;
     private XmlSchemaNamedImpl namedDelegate;
 
     /**
@@ -44,14 +43,6 @@
         namedDelegate = new XmlSchemaNamedImpl(parent, true);
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
     public String getPublic() {
         return publicNotation;
     }
@@ -88,4 +79,20 @@
         return namedDelegate.toString();
     }
 
+    void setPublicNotation(String publicNotation) {
+        this.publicNotation = publicNotation;
+    }
+
+    String getPublicNotation() {
+        return publicNotation;
+    }
+
+    public String getName() {
+        return namedDelegate.getName();
+    }
+
+    public void setName(String name) {
+        namedDelegate.setName(name);
+    }
+
 }

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java?rev=732461&r1=732460&r2=732461&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaSerializer.java Wed Jan  7 12:12:22 2009
@@ -503,9 +503,9 @@
             Element annotation = serializeAnnotation(doc, attributeGroupObj.getAnnotation(), schema);
             attributeGroup.appendChild(annotation);
         }
-        int attributesLength = attributeGroupObj.attributes.getCount();
+        int attributesLength = attributeGroupObj.getAttributes().getCount();
         for (int i = 0; i < attributesLength; i++) {
-            XmlSchemaObject obj = attributeGroupObj.attributes.getItem(i);
+            XmlSchemaObject obj = attributeGroupObj.getAttributes().getItem(i);
 
             if (obj instanceof XmlSchemaAttribute) {
                 Element attr = serializeAttribute(doc, (XmlSchemaAttribute)obj, schema);
@@ -516,8 +516,8 @@
             }
         }
 
-        if (attributeGroupObj.anyAttribute != null) {
-            Element anyAttribute = serializeAnyAttribute(doc, attributeGroupObj.anyAttribute, schema);
+        if (attributeGroupObj.getAnyAttribute() != null) {
+            Element anyAttribute = serializeAnyAttribute(doc, attributeGroupObj.getAnyAttribute(), schema);
             attributeGroup.appendChild(anyAttribute);
         }
 
@@ -914,9 +914,9 @@
             serializedComplexType.setAttribute("block", complexTypeObj.toString());
         }
         
-        if (complexTypeObj.finalDerivation != null 
-            && complexTypeObj.finalDerivation != XmlSchemaDerivationMethod.NONE) {
-            serializedComplexType.setAttribute("final", complexTypeObj.finalDerivation.toString());
+        if (complexTypeObj.getFinalDerivation() != null 
+            && complexTypeObj.getFinalDerivation() != XmlSchemaDerivationMethod.NONE) {
+            serializedComplexType.setAttribute("final", complexTypeObj.getFinalDerivation().toString());
         }
 
         XmlSchemaObjectCollection attrColl = complexTypeObj.attributes;
@@ -1222,14 +1222,14 @@
             group.appendChild(annotation);
         }
 
-        if (groupObj.particle instanceof XmlSchemaSequence) {
-            Element sequence = serializeSequence(doc, (XmlSchemaSequence)groupObj.particle, schema);
+        if (groupObj.getParticle() instanceof XmlSchemaSequence) {
+            Element sequence = serializeSequence(doc, (XmlSchemaSequence)groupObj.getParticle(), schema);
             group.appendChild(sequence);
-        } else if (groupObj.particle instanceof XmlSchemaChoice) {
-            Element choice = serializeChoice(doc, (XmlSchemaChoice)groupObj.particle, schema);
+        } else if (groupObj.getParticle() instanceof XmlSchemaChoice) {
+            Element choice = serializeChoice(doc, (XmlSchemaChoice)groupObj.getParticle(), schema);
             group.appendChild(choice);
-        } else if (groupObj.particle instanceof XmlSchemaAll) {
-            Element all = serializeAll(doc, (XmlSchemaAll)groupObj.particle, schema);
+        } else if (groupObj.getParticle() instanceof XmlSchemaAll) {
+            Element all = serializeAll(doc, (XmlSchemaAll)groupObj.getParticle(), schema);
             group.appendChild(all);
         }
 
@@ -1913,9 +1913,9 @@
         Element serializedSimpleType = createNewElement(doc, "simpleType", schema.schemaNamespacePrefix,
                                                         XmlSchema.SCHEMA_NS);
 
-        if (simpleTypeObj.finalDerivation != null 
-            && simpleTypeObj.finalDerivation != XmlSchemaDerivationMethod.NONE) {
-            serializedSimpleType.setAttribute("final", simpleTypeObj.finalDerivation.toString());
+        if (simpleTypeObj.getFinalDerivation() != null 
+            && simpleTypeObj.getFinalDerivation() != XmlSchemaDerivationMethod.NONE) {
+            serializedSimpleType.setAttribute("final", simpleTypeObj.getFinalDerivation().toString());
         }
         if (simpleTypeObj.getId() != null) {
             serializedSimpleType.setAttribute("id", simpleTypeObj.getId());

Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java?rev=732461&r1=732460&r2=732461&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java Wed Jan  7 12:12:22 2009
@@ -31,11 +31,10 @@
 
 public abstract class XmlSchemaType extends XmlSchemaAnnotated implements XmlSchemaNamed {
 
-    Object baseSchemaType;
-    XmlSchemaDerivationMethod deriveBy;
-    XmlSchemaDerivationMethod finalDerivation;
-    XmlSchemaDerivationMethod finalResolved;
-    boolean isMixed;
+    private XmlSchemaDerivationMethod deriveBy;
+    private XmlSchemaDerivationMethod finalDerivation;
+    private XmlSchemaDerivationMethod finalResolved;
+    private boolean isMixed;
 
     private XmlSchemaNamedImpl namedDelegate;
 
@@ -48,17 +47,6 @@
     }
 
     /**
-     * This function returns null. It is intended at some point to return the base type in the event of a
-     * restriction, but that functionality is not implemented.
-     * 
-     * @see #getBaseSchemaTypeName()
-     * @return null
-     */
-    public Object getBaseSchemaType() {
-        return baseSchemaType;
-    }
-
-    /**
      * If there is a base schema type, which by definition has to have a global name, return it.
      * 
      * @return the qualified name of the base schema type. Return null if none (e.g. for simple types).
@@ -127,4 +115,20 @@
     public void setName(String name) {
         namedDelegate.setName(name);
     }
+
+    void setFinalResolved(XmlSchemaDerivationMethod finalResolved) {
+        this.finalResolved = finalResolved;
+    }
+
+    public void setFinalDerivation(XmlSchemaDerivationMethod finalDerivation) {
+        this.finalDerivation = finalDerivation;
+    }
+
+    public XmlSchemaDerivationMethod getFinalDerivation() {
+        return finalDerivation;
+    }
+
+    public void setDeriveBy(XmlSchemaDerivationMethod deriveBy) {
+        this.deriveBy = deriveBy;
+    }
 }