[jboss-cvs] JBossAS SVN: r59000 - in projects/microcontainer/trunk: kernel/src/main/org/jboss/kernel/plugins/deployment/xml spring-int/src/main/org/jboss/spring/deployment/xml spring-int/src/resources/org/jboss/test/spring/test

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 12 12:32:35 EST 2006


Author: alesj
Date: 2006-12-12 12:32:21 -0500 (Tue, 12 Dec 2006)
New Revision: 59000

Added:
   projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringMapHandler.java
Modified:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/xml/MapHandler.java
   projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBindingHelper.java
   projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml
Log:
JBMICROCONT-26; inital code

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/xml/MapHandler.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/xml/MapHandler.java	2006-12-12 17:25:52 UTC (rev 58999)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/deployment/xml/MapHandler.java	2006-12-12 17:32:21 UTC (rev 59000)
@@ -47,16 +47,16 @@
 
    public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
    {
-      AbstractMapMetaData collection = (AbstractMapMetaData) o;
+      AbstractMapMetaData map = (AbstractMapMetaData) o;
       for (int i = 0; i < attrs.getLength(); ++i)
       {
          String localName = attrs.getLocalName(i);
          if ("class".equals(localName))
-            collection.setType(attrs.getValue(i));
+            map.setType(attrs.getValue(i));
          else if ("keyClass".equals(localName))
-            collection.setKeyType(attrs.getValue(i));
+            map.setKeyType(attrs.getValue(i));
          else if ("valueClass".equals(localName))
-            collection.setValueType(attrs.getValue(i));
+            map.setValueType(attrs.getValue(i));
       }
    }
 }

Added: projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringMapHandler.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringMapHandler.java	2006-12-12 17:25:52 UTC (rev 58999)
+++ projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringMapHandler.java	2006-12-12 17:32:21 UTC (rev 59000)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.spring.deployment.xml;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.beans.metadata.plugins.AbstractMapMetaData;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler;
+import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding;
+import org.xml.sax.Attributes;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SpringMapHandler extends DefaultElementHandler
+{
+   /**
+    * The handler
+    */
+   public static final SpringMapHandler HANDLER = new SpringMapHandler();
+
+   public Object startElement(Object parent, QName name, ElementBinding element)
+   {
+      return new AbstractMapMetaData();
+   }
+
+   public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
+   {
+      AbstractMapMetaData map = (AbstractMapMetaData) o;
+      for (int i = 0; i < attrs.getLength(); ++i)
+      {
+         String localName = attrs.getLocalName(i);
+         if ("key-type".equals(localName))
+            map.setKeyType(attrs.getValue(i));
+      }
+   }
+
+}

Modified: projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBindingHelper.java
===================================================================
--- projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBindingHelper.java	2006-12-12 17:25:52 UTC (rev 58999)
+++ projects/microcontainer/trunk/spring-int/src/main/org/jboss/spring/deployment/xml/SpringSchemaBindingHelper.java	2006-12-12 17:32:21 UTC (rev 59000)
@@ -87,7 +87,7 @@
 
    public static void initMapHandler(TypeBinding typeBinding)
    {
-      typeBinding.setHandler(MapHandler.HANDLER);
+      typeBinding.setHandler(SpringMapHandler.HANDLER);
       // entry has an entry
       typeBinding.pushInterceptor(SpringSchemaBinding.entryQName, MapEntryInterceptor.INTERCEPTOR);
    }

Modified: projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml
===================================================================
--- projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml	2006-12-12 17:25:52 UTC (rev 58999)
+++ projects/microcontainer/trunk/spring-int/src/resources/org/jboss/test/spring/test/TestInstantiate.xml	2006-12-12 17:32:21 UTC (rev 59000)
@@ -5,14 +5,14 @@
    <constructor-arg index="0"><value>1</value></constructor-arg>
    <constructor-arg index="1"><value>3.1415</value></constructor-arg>
    <property name="list">
-      <list>
+      <list value-type="java.lang.String">
          <value>one</value>
          <value>two</value>
          <value>three</value>
       </list>
    </property>
    <property name="set">
-      <set>
+      <set value-type="java.lang.String">
          <value>one</value>
          <value>two</value>
          <value>one</value>




More information about the jboss-cvs-commits mailing list