Update of /cvsroot/jaxme/JaxMe2/src/net/sf/jaxme/generator/events/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv9150/src/net/sf/jaxme/generator/events/impl

Modified Files:
        TypeHandler.java JMSchemaInfo.java JMTypeListener.java 
        JMSchemaBindingsListener.java 
Added Files:
        SchemaDeclaration.java 
Log Message:
Added the JdbcSchemaWriter; see examples/jdbc/session.xsd and
docs/Reference.html. Added xs:schema/xs:annotation/xs:appinfo/jm:schema.


--- NEW FILE: SchemaDeclaration.java ---
package net.sf.jaxme.generator.events.impl;

import org.w3c.dom.Node;

public class SchemaDeclaration {
  private String resourceName;
  private Node contentNode;

  public void setResourceName(String pName) {
    resourceName = pName;
  }

  public String getResourceName() {
    return resourceName;
  }

  public void setContentNode(Node pNode) {
    contentNode = pNode;
  }

  public Node getContentNode() {
    return contentNode;
  }
}

Index: TypeHandler.java
===================================================================
RCS file: 
/cvsroot/jaxme/JaxMe2/src/net/sf/jaxme/generator/events/impl/TypeHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TypeHandler.java    11 Mar 2003 20:54:23 -0000      1.1
+++ TypeHandler.java    31 Mar 2003 02:50:00 -0000      1.2
@@ -4,7 +4,7 @@
 
 import net.sf.jaxme.generator.events.TypeListener;
 import net.sf.jaxme.generator.jaxb.impl.JAXBSchemaImpl;
-import net.sf.jaxme.generator.types.SchemaTypeContext;
+import net.sf.jaxme.generator.types.SchemaTypeInContext;
 import org.w3c.dom.Element;
 
 
@@ -13,7 +13,7 @@
  */
 public class TypeHandler extends HandlerImpl implements TypeListener {
   public void eventType(JAXBSchemaImpl pSchema, Element pDocumentElement,
-                         Element pTypeElement, SchemaTypeContext pType)
+                         Element pTypeElement, SchemaTypeInContext pType)
       throws Exception {
     for (Iterator iter = getListeners();  iter.hasNext();  ) {
       ((TypeListener) iter.next()).eventType(pSchema, pDocumentElement,

Index: JMSchemaInfo.java
===================================================================
RCS file: 
/cvsroot/jaxme/JaxMe2/src/net/sf/jaxme/generator/events/impl/JMSchemaInfo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- JMSchemaInfo.java   21 Mar 2003 21:31:07 -0000      1.2
+++ JMSchemaInfo.java   31 Mar 2003 02:50:01 -0000      1.3
@@ -8,11 +8,9 @@
  */
 public class JMSchemaInfo extends JMGlobalInfo {
   private JMGlobalInfo globalInfo;
+  private SchemaDeclaration schemaDeclaration;
 
   public JMSchemaInfo(JMGlobalInfo pGlobalInfo) {
-    if (pGlobalInfo == null) {
-      throw new NullPointerException("Global info must not be null");
-    }
     globalInfo = pGlobalInfo;
   }
 
@@ -39,5 +37,13 @@
       }
     }
     return null;
+  }
+
+  public void setSchemaDeclaration(SchemaDeclaration pSchemaDeclaration) {
+    schemaDeclaration = pSchemaDeclaration;
+  }
+
+  public SchemaDeclaration getSchemaDeclaration() {
+    return schemaDeclaration;
   }
 }

Index: JMTypeListener.java
===================================================================
RCS file: 
/cvsroot/jaxme/JaxMe2/src/net/sf/jaxme/generator/events/impl/JMTypeListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- JMTypeListener.java 21 Mar 2003 21:31:07 -0000      1.2
+++ JMTypeListener.java 31 Mar 2003 02:50:01 -0000      1.3
@@ -2,7 +2,7 @@
 
 import net.sf.jaxme.generator.events.TypeListener;
 import net.sf.jaxme.generator.jaxb.impl.JAXBSchemaImpl;
-import net.sf.jaxme.generator.types.SchemaTypeContext;
+import net.sf.jaxme.generator.types.SchemaTypeInContext;
 import org.w3c.dom.Element;
 
 /**
@@ -14,7 +14,7 @@
   }
 
   public void eventType(JAXBSchemaImpl pSchema, Element pDocumentElement,
-                         Element pTypeElement, SchemaTypeContext pType)
+                         Element pTypeElement, SchemaTypeInContext pType)
       throws Exception {
   }
 }

Index: JMSchemaBindingsListener.java
===================================================================
RCS file: 
/cvsroot/jaxme/JaxMe2/src/net/sf/jaxme/generator/events/impl/JMSchemaBindingsListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- JMSchemaBindingsListener.java       21 Mar 2003 21:31:07 -0000      1.2
+++ JMSchemaBindingsListener.java       31 Mar 2003 02:50:01 -0000      1.3
@@ -61,6 +61,7 @@
                                    Element pDocumentElement,
                                    Element pAppInfoElement)
       throws Exception {
+    final String mName = "eventSchemaBindings";
     if (pAppInfoElement == null) {
       return;
     }
@@ -73,6 +74,24 @@
 
       JMSchemaInfo schemaInfo = JaxMeSchemaWriter.getSchemaInfo(pSchema, getKey());
       schemaInfo.addClassDeclaration(classDeclaration);
+    }
+
+    Iterator iter = DOM.getChildElements(pAppInfoElement,
+                                         JaxMeSchemaWriter.JAXME_SCHEMA_URI,
+                                         "schema");
+    if (iter.hasNext()) {
+      SchemaDeclaration schemaDeclaration = new SchemaDeclaration();
+      schemaDeclaration.setContentNode(pDocumentElement);
+      Configurator.parse((Node) iter.next(), schemaDeclaration, 
JaxMeSchemaWriter.JAXME_SCHEMA_URI);
+      JMSchemaInfo schemaInfo = JaxMeSchemaWriter.getSchemaInfo(pSchema, getKey());
+      schemaInfo.setSchemaDeclaration(schemaDeclaration);
+
+      if (iter.hasNext()) {
+        Element node = (Element) iter.next();
+        getJaxMeSchemaReader().logWarning(pSchema, node, mName,
+                                          "Ignoring additional schema declaration " +
+                                          node.getNodeName());
+      }
     }
   }
 }




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Jaxme-jaxb-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxme-jaxb-dev

Reply via email to