geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r896187 [1/6] - in /geronimo/xbean/trunk/xbean-blueprint: ./ src/main/java/org/apache/xbean/blueprint/ src/main/java/org/apache/xbean/blueprint/context/ src/main/java/org/apache/xbean/blueprint/context/impl/ src/main/java/org/apache/xbean/b...
Date Tue, 05 Jan 2010 19:31:42 GMT
Author: djencks
Date: Tue Jan  5 19:31:05 2010
New Revision: 896187

URL: http://svn.apache.org/viewvc?rev=896187&view=rev
Log:
XBEAN-142 port xbean-spring to xbean-blueprint.  First probably incomplete commit.... I think idea messed up the .svn files

Added:
    geronimo/xbean/trunk/xbean-blueprint/
      - copied from r894135, geronimo/xbean/trunk/xbean-spring/
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/DocumentationGenerator.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/ElementMapping.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/GeneratorPlugin.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/InvalidModelException.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/LogFacade.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/MapMapping.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/MappingGeneratorTask.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/MappingLoader.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/NamespaceMapping.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/ParameterMapping.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/QdoxMappingLoader.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/SchemaGenerator.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/Type.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/Utils.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/WikiDocumentationGenerator.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/XmlMetadataGenerator.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/XmlWriter.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/XsdGenerator.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BadAttributeTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BadElementTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BadNamespaceTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerNullTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingXBeanNSTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingXBeanSystemPropTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BeerUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/BlueprintTestSupport.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/ComponentTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FavoriteUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FavoriteUsingXBeanMixedTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FavoriteUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/FlatMapTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/GinUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanAndPropertiesTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/KegXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/PizzaUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/PizzaUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/PizzaUsingXBeanWinBeanRefTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/PizzaUsingXBeanWithJavaNamespaceTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/PizzaUsingXBeanWithPropertiesTextNodeTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/QNameUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/QNameUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RecipeUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RecipeUsingXBeanMixedTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RecipeUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingResourceXmlApplicationContextTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingSpringExtendedTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingXBeanAsRootTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingXBeanMixedTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/RestaurantUsingXBeanWithSimplerConfigTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SaladUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SaladUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SocketAddressSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SocketAddressXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SoupUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/SpringExtensionTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/VodkaUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/VodkaUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/WineUsingSpringTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/WineUsingXBeanTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/impl/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgsTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/BeerService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/ContainerBean.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/DummyBean.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/FavoriteService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/FlatMapService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/GinService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/InnerBean.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/KegService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/MilliLittersPropertyEditor.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/PizzaService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/QNameService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/Recipe.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/RecipeService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/RestaurantService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/SaladService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/SocketAddressFactory.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/SocketService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/SoupService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/VodkaService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/example/WineService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/generator/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/generator/CheeseService.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/blueprint/generator/ModelTest.java   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/component
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/pizza-simple
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/restaurant
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/salad
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/blueprint/http/xbean.apache.org/schemas/soup
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/bad-attribute.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/bad-element.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/bad-namespace.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-normal.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-ns.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-null.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean-system-prop.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/beer-xbean.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/component-spring.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/component-xbean.xml   (with props)
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/org/apache/xbean/blueprint/context/favorite-normal.xml   (with props)
Removed:
    geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/spring/
    geronimo/xbean/trunk/xbean-blueprint/src/test/java/org/apache/xbean/spring/
    geronimo/xbean/trunk/xbean-blueprint/src/test/resources/META-INF/services/org/apache/xbean/spring/
Modified:
    geronimo/xbean/trunk/xbean-blueprint/pom.xml

Modified: geronimo/xbean/trunk/xbean-blueprint/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/pom.xml?rev=896187&r1=894135&r2=896187&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-blueprint/pom.xml Tue Jan  5 19:31:05 2010
@@ -29,45 +29,52 @@
         <version>3.7-SNAPSHOT</version>
     </parent>
 
-    <artifactId>xbean-spring</artifactId>
+    <artifactId>xbean-blueprint</artifactId>
     <packaging>bundle</packaging>
-    <name>Apache XBean :: Spring</name>
+    <name>Apache XBean :: OSGI Blueprint Namespace Handler</name>
 
-    <description>xbean-spring provides a schema-driven proprietary namespace handler for spring contexts</description>
+    <description>xbean-blueprint provides a schema-driven namespace handler for Apache Aries Blueprint</description>
 
     <properties>
-        <xbean.osgi.import.pkg>
-            com.thoughtworks.qdox*;resolution:=optional,
-            org.apache.tools.ant*;resolution:=optional,
-            org.springframework.core;resolution:=optional,
-            org.springframework.web*;resolution:=optional,
-            *
-        </xbean.osgi.import.pkg>
-    </properties>
+        <pax.logging.version>1.4.1-SNAPSHOT</pax.logging.version>
 
+    </properties>
     <dependencies>
 
         <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.api</artifactId>
+            <version>1.0.0-incubating-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+            <version>1.0.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-beans</artifactId>
-            <scope>provided</scope>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+            <version>${pax.logging.version}</version>
         </dependency>
 
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
             <scope>provided</scope>
         </dependency>
 
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-web</artifactId>
-            <optional>true</optional>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-service</artifactId>
+            <version>${pax.logging.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
@@ -113,17 +120,17 @@
                         </goals>
                         <configuration>
                             <tasks>
-                                <taskdef classname="org.apache.xbean.spring.generator.MappingGeneratorTask" name="mapping">
+                                <taskdef classname="org.apache.xbean.blueprint.generator.MappingGeneratorTask" name="mapping">
                                     <classpath>
-                                        <pathelement path="${basedir}/target/classes" />
-                                        <pathelement path="${basedir}/target/test-classes" />
-                                        <path refid="maven.runtime.classpath" />
+                                        <pathelement path="${basedir}/target/classes"/>
+                                        <pathelement path="${basedir}/target/test-classes"/>
+                                        <path refid="maven.runtime.classpath"/>
                                     </classpath>
                                 </taskdef>
-                                <mapping namespace="http://xbean.apache.org/schemas/pizza" srcdir="src/test/java" destFile="target/restaurant.xsd" metaInfDir="${basedir}/target/test-generated/" />
-                                <copy todir="${basedir}/target/test-classes">
-                                    <fileset dir="${basedir}/target/test-generated" />
-                                </copy>
+                                <mapping namespace="http://xbean.apache.org/schemas/pizza" srcdir="src/test/java" destFile="target/restaurant.xsd" metaInfDir="${basedir}/target/test-classes/"/>
+                                <!--<copy todir="${basedir}/target/test-classes">-->
+                                    <!--<fileset dir="${basedir}/target/test-generated"/>-->
+                                <!--</copy>-->
                             </tasks>
                         </configuration>
                     </execution>
@@ -138,12 +145,8 @@
                         <Import-Package>
                             com.thoughtworks.qdox*;resolution:=optional,
                             org.apache.tools.ant*;resolution:=optional,
-                            org.springframework.core;resolution:=optional,
-                            org.springframework.web*;resolution:=optional,
                             *
                         </Import-Package>
-                        <DynamicImport-Package>META-INF.services.org.apache.xbean.spring.*,META-INF.services.org.xbean.spring</DynamicImport-Package>
-                        <_failok>true</_failok>
                     </instructions>
                 </configuration>
             </plugin>

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,46 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import java.beans.PropertyEditorSupport;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
+
+/**
+ * Editor for <code>java.util.Date</code>
+ */
+public class DateEditor extends PropertyEditorSupport {
+
+    private DateFormat dateFormat = DateFormat.getInstance();
+    
+	public void setAsText(String text) throws IllegalArgumentException {
+		try {
+            setValue(dateFormat.parse(text));
+		}
+        catch (ParseException e) {
+            throw new IllegalArgumentException(
+                    "Could not convert Date for " + text + ": " + e.getMessage());
+        }
+	}
+
+	public String getAsText() {
+        Date value = (Date) getValue();
+		return (value != null ? dateFormat.format(value) : "");
+	}
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DateEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,102 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+/**
+ * DefaultProperty contains the default value assigned to a property with a specific name and type.
+ * @author Dain Sundstrom
+ * @version $Id$
+ * @since 2.0
+ */
+public class DefaultProperty {
+    private String name;
+    private Class type;
+    private String value;
+
+    /**
+     * Creates a new empty default property.  This instance is unusable until the name, type and values are assigned.
+     */
+    public DefaultProperty() {
+    }
+
+    /**
+     * Creates new default property value for a property with the specified name and type.
+     * @param name the name of the property
+     * @param type the type of the property
+     * @param value the default value
+     */
+    public DefaultProperty(String name, Class type, String value) {
+        this.name = name;
+        this.type = type;
+        this.value = value;
+    }
+
+    /**
+     * Gets the property name.
+     * @return the property name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the property name.
+     * @param name the property name
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * Gets the property type.
+     * @return the property type
+     */
+    public Class getType() {
+        return type;
+    }
+
+    /**
+     * Sets the property type.
+     * @param type the property type
+     */
+    public void setType(Class type) {
+        this.type = type;
+    }
+
+    /**
+     * Gets the default value.
+     * @return the default value
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the default value.
+     * @param value the default value
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() {
+        return "[" + name + ", " + type + ", " + value + "]";
+    }
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/DefaultProperty.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,36 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import java.beans.PropertyEditorSupport;
+import java.io.File;
+
+/**
+ * Editor for <code>java.io.File</code>
+ */
+public class FileEditor extends PropertyEditorSupport {
+
+    public void setAsText(String text) throws IllegalArgumentException {
+        setValue(new File(text));
+    }
+
+    public String getAsText() {
+        File value = (File) getValue();
+        return (value != null ? value.toString() : "");
+    }
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/FileEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,219 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+/**
+ * A helper class which understands how to map an XML namespaced element to
+ * Spring bean configurations
+ *
+ * @author James Strachan
+ * @version $Id$
+ * @since 2.0
+ */
+public class MappingMetaData {
+    private Properties properties;
+    private String packageName;
+
+    /**
+     * Creates an empty MappingMetaData for the specified Java package.
+     * @param packageName the Java package to map
+     */
+    public MappingMetaData(String packageName) {
+        this.packageName = packageName;
+        this.properties = new Properties();
+    }
+
+    /**
+     * Creates MappingMetaData using the specified properties which contan the package name.
+     * @param properties
+     */
+    public MappingMetaData(Properties properties) {
+        this.properties = properties;
+    }
+
+    /**
+     * Returns the Java class name for the given XML element name
+     */
+    public String getClassName(String localName) {
+        String className = properties.getProperty(localName);
+        if (className == null && packageName != null) {
+            if (packageName.length() > 0) {
+                className = packageName + "." + localName;
+            }
+            else {
+                className = localName;
+            }
+        }
+        return className;
+    }
+
+    /**
+     * Returns the property name for the given element and attribute name
+     * 
+     * @param elementName the XML local name of the element
+     * @param attributeName the XML local name of the attribute
+     * @return the property name to use or null if the attribute is not a valid property
+     */
+    public String getPropertyName(String elementName, String attributeName) {
+        return properties.getProperty(elementName + ".alias." + attributeName, attributeName);
+    }
+
+    /**
+     * Returns a valid property name if the childElementName maps to a nested list property
+     * 
+     * @param elementName the owner element
+     * @param childElementName is the child element name which maps to the nested list property 
+     * @return the property name if available or null if it is not applicable
+     */
+    public String getNestedListProperty(String elementName, String childElementName) {
+        return properties.getProperty(elementName + ".list." + childElementName);
+    }
+    
+    /**
+     * Returns a valid property name if the childElementName maps to a nested bean property
+     * 
+     * @param elementName the owner element
+     * @param childElementName is the child element name which maps to the nested bean property 
+     * @return the property name if available or null if it is not applicable
+     */
+    public String getNestedProperty(String elementName, String childElementName) {
+        return properties.getProperty(elementName + ".alias." + childElementName);
+    }
+
+    public boolean isDefaultConstructor(Constructor constructor) {
+        String property = properties.getProperty(constructorToPropertyName(constructor) + ".default");
+        if (property != null) {
+            return Boolean.valueOf(property).booleanValue();
+        }
+        return false;
+    }
+
+    public boolean isDefaultFactoryMethod(Class beanClass, Method factoryMethod) {
+        String property = properties.getProperty(methodToPropertyName(beanClass, factoryMethod) + ".default");
+        if (property != null) {
+            return Boolean.valueOf(property).booleanValue();
+        }
+        return false;
+    }
+
+    public String[] getParameterNames(Constructor constructor) {
+        String property = properties.getProperty(constructorToPropertyName(constructor) + ".parameterNames");
+        if (property != null) {
+            ArrayList names = Collections.list(new StringTokenizer(property, ", "));
+            return (String[]) names.toArray(new String[0]);
+        }
+        return null;
+    }
+
+    public String[] getParameterNames(Class beanClass, Method factoryMethod) {
+        String property = properties.getProperty(methodToPropertyName(beanClass, factoryMethod) + ".parameterNames");
+        if (property != null) {
+            ArrayList names = Collections.list(new StringTokenizer(property, ", "));
+            return (String[]) names.toArray(new String[0]);
+        }
+        return null;
+    }
+
+    public static String constructorToPropertyName(Constructor constructor) {
+        StringBuffer buf = new StringBuffer();
+        buf.append(constructor.getName()).append("(");
+        Class[] parameterTypes = constructor.getParameterTypes();
+        for (int i = 0; i < parameterTypes.length; i++) {
+            Class parameterType = parameterTypes[i];
+            buf.append(parameterType.getName());
+            if (i < parameterTypes.length - 1) {
+                buf.append(",");
+            }
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+    public static String methodToPropertyName(Class beanClass, Method method) {
+        StringBuffer buf = new StringBuffer();
+        buf.append(beanClass.getName()).append(".");
+        buf.append(method.getName()).append("(");
+        Class[] parameterTypes = method.getParameterTypes();
+        for (int i = 0; i < parameterTypes.length; i++) {
+            Class parameterType = parameterTypes[i];
+            buf.append(parameterType.getName());
+            if (i < parameterTypes.length - 1) {
+                buf.append(",");
+            }
+        }
+        buf.append(")");
+        return buf.toString();
+    }
+
+    public String getInitMethodName(String elementName) {
+        return properties.getProperty(elementName + ".initMethod");
+    }
+
+    public String getDestroyMethodName(String elementName) {
+        return properties.getProperty(elementName + ".destroyMethod");
+    }
+
+    public String getFactoryMethodName(String elementName) {
+        return properties.getProperty(elementName + ".factoryMethod");
+    }
+
+    public String getContentProperty(String elementName) {
+        return properties.getProperty(elementName + ".contentProperty");
+    }
+    
+    public String getMapEntryName(String elementName, String property) {
+        return properties.getProperty(elementName + "." + property + ".map.entryName");
+    }
+
+    public String getMapKeyName(String elementName, String property) {
+        return properties.getProperty(elementName + "." + property + ".map.keyName");
+    }
+
+    public boolean isFlatMap(String elementName, String property) {
+        return properties.getProperty(elementName + "." + property + ".map.flat") != null;
+    }
+    
+    public String getMapDupsMode(String elementName, String property) {
+        return properties.getProperty(elementName + "." + property + ".map.dups");
+    }
+    
+    public String getMapDefaultKey(String elementName, String property) {
+        return properties.getProperty(elementName + "." + property + ".map.defaultKey");
+    }
+    
+    public String getFlatCollectionProperty(String elementName, String property)
+    {
+        return properties.getProperty(elementName + "." + property + ".flatCollection");
+    }
+    
+    public boolean isFlatProperty(String elementName, String property)  {
+        return properties.getProperty(elementName + "." + property + ".flat") != null;
+    }
+    
+    public String getPropertyEditor(String elementName, String property)
+    {
+        return properties.getProperty(elementName + "." + property + ".propertyEditor");
+    }
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/MappingMetaData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,349 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutableValueMetadata;
+import org.osgi.service.blueprint.container.ComponentDefinitionException;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * NamedConstructorArgs is a BeanFactoryPostProcessor that converts property declarations into indexed constructor args
+ * based on the the constructor parameter names annotation.  This process first selects a constructor and then fills in
+ * the constructor arguments from the properties defined in the bean definition.  If a property is not defined in the
+ * bean definition, first the defaultValues map is checked for a value and if a value is not present a Java default
+ * value is provided for the constructor argument (e.g. numbers are assigned 0 and objects are assigned null).
+ *
+ * @author Dain Sundstrom
+ * @version $Id$
+ * @since 2.0
+ */
+public class NamedConstructorArgs {
+    private Map<PropertyKey, String> defaultValues = new HashMap<PropertyKey, String>();
+
+    /**
+     * Gets the default values that are assigned to constructor arguments without a defined value.
+     *
+     * @return the default values that are assigned to constructor arguments without a defined value
+     */
+    public List<DefaultProperty> getDefaultValues() {
+        List<DefaultProperty> values = new LinkedList<DefaultProperty>();
+        for (Map.Entry<PropertyKey, String> entry : defaultValues.entrySet()) {
+            PropertyKey key = entry.getKey();
+            String value = entry.getValue();
+            values.add(new DefaultProperty(key.name, key.type, value));
+        }
+        return values;
+    }
+
+    /**
+     * Sets the default values that are assigned to constructor arguments without a defined value.
+     *
+     * @param defaultValues the values that are assigned to constructor arguments without a defined value
+     */
+    public void setDefaultValues(List<DefaultProperty> defaultValues) {
+        this.defaultValues.clear();
+        for (DefaultProperty defaultValue : defaultValues) {
+            addDefaultValue(defaultValue);
+        }
+    }
+
+    /**
+     * Adds a default value for a property with the specified name and type.
+     *
+     * @param name  the name of the property
+     * @param type  the type of the property
+     * @param value the default value for a property with the specified name and type
+     */
+    public void addDefaultValue(String name, Class type, String value) {
+        defaultValues.put(new PropertyKey(name, type), value);
+    }
+
+    /**
+     * Adds a defautl value for a property.
+     *
+     * @param defaultProperty the default property information
+     */
+    private void addDefaultValue(DefaultProperty defaultProperty) {
+        defaultValues.put(new PropertyKey(defaultProperty.getName(), defaultProperty.getType()), defaultProperty.getValue());
+    }
+
+    public void processParameters(MutableBeanMetadata beanMetadata, MappingMetaData metadata, ParserContext parserContext) {
+
+        // if this bean already has constructor arguments defined, don't mess with them
+        if (beanMetadata.getArguments().size() > 0) {
+            return;
+        }
+
+        // try to get a list of constructor arg names to use
+        ConstructionInfo constructionInfo = selectConstructionMethod(beanMetadata, metadata);
+        if (constructionInfo == null) {
+            return;
+        }
+
+        // remove each named property and add an indexed constructor arg
+        List<BeanProperty> beanProperties = beanMetadata.getProperties();
+        LinkedHashMap<String, BeanProperty> propMap = new LinkedHashMap<String, BeanProperty>();
+        for (BeanProperty beanProperty : beanProperties) {
+            propMap.put(beanProperty.getName(), beanProperty);
+        }
+        String[] parameterNames = constructionInfo.parameterNames;
+        Class[] parameterTypes = constructionInfo.parameterTypes;
+        for (int i = 0; i < parameterNames.length; i++) {
+            String parameterName = parameterNames[i];
+            Class parameterType = parameterTypes[i];
+
+            BeanProperty beanProperty = propMap.get(parameterName);
+            if (beanProperty != null) {
+                propMap.remove(parameterName);
+                beanMetadata.removeProperty(beanProperty);
+                beanMetadata.addArgument(beanProperty.getValue(), parameterType.getName(), i);
+            } else {
+                String defaultValue = defaultValues.get(new PropertyKey(parameterName, parameterType));
+                if (defaultValue == null) {
+                    defaultValue = DEFAULT_VALUE.get(parameterType);
+                }
+//                if (defaultValue instanceof FactoryBean) {
+//                    try {
+//                        defaultValue = ((FactoryBean)defaultValue).getObject();
+//                    } catch (Exception e) {
+//                        throw new FatalBeanException("Unable to get object value from bean factory", e);
+//                    }
+//                }
+                MutableValueMetadata valueMetadata = parserContext.createMetadata(MutableValueMetadata.class);
+                valueMetadata.setStringValue(defaultValue);
+                valueMetadata.setType(parameterType.getName());
+                beanMetadata.addArgument(valueMetadata, parameterType.getName(), i);
+            }
+        }
+
+        // todo set any usable default values on the bean definition
+    }
+
+    private ConstructionInfo selectConstructionMethod(MutableBeanMetadata beanMetadata, MappingMetaData metadata) {
+        Class beanClass = beanMetadata.getRuntimeClass();
+
+        // get a set containing the names of the defined properties
+        Set<String> definedProperties = new HashSet<String>();
+        List<BeanProperty> values = beanMetadata.getProperties();
+        for (BeanProperty beanProperty : values) {
+            definedProperties.add(beanProperty.getName());
+        }
+
+        // first check for a factory method
+        if (beanMetadata.getFactoryMethod() != null) {
+            return selectFactory(beanClass, beanMetadata, metadata, definedProperties);
+        } else {
+            return selectConstructor(beanClass, metadata, definedProperties);
+        }
+    }
+
+    private ConstructionInfo selectFactory(Class beanClass, MutableBeanMetadata beanMetadata, MappingMetaData metadata, Set definedProperties) {
+        String factoryMethodName = beanMetadata.getFactoryMethod();
+
+        // get the factory methods sorted by longest arg length first
+        Method[] methods = beanClass.getMethods();
+        List<Method> factoryMethods = new ArrayList<Method>(methods.length);
+        for (Method method : methods) {
+            if (method.getName().equals(factoryMethodName)) {
+                factoryMethods.add(method);
+            }
+        }
+
+        Collections.sort(factoryMethods, new MethodArgLengthComparator());
+
+        // if a factory method has been annotated as the default constructor we always use that constructor
+        for (Method factoryMethod : factoryMethods) {
+            if (metadata.isDefaultFactoryMethod(beanClass, factoryMethod)) {
+                return new ConstructionInfo(beanClass, factoryMethod, metadata);
+            }
+        }
+
+        // try to find a constructor for which we have all of the properties defined
+        for (Method factoryMethod : factoryMethods) {
+            ConstructionInfo constructionInfo = new ConstructionInfo(beanClass, factoryMethod, metadata);
+            if (isUsableConstructor(constructionInfo, definedProperties)) {
+                return constructionInfo;
+            }
+        }
+        return null;
+    }
+
+    private ConstructionInfo selectConstructor(Class beanClass, MappingMetaData metadata, Set definedProperties) {
+        // get the constructors sorted by longest arg length first
+        List<Constructor> constructors = new ArrayList<Constructor>(Arrays.asList(beanClass.getConstructors()));
+        Collections.sort(constructors, new ConstructorArgLengthComparator());
+
+        // if a constructor has been annotated as the default constructor we always use that constructor
+        for (Constructor constructor : constructors) {
+            if (metadata.isDefaultConstructor(constructor)) {
+                return new ConstructionInfo(constructor, metadata);
+            }
+        }
+
+        // try to find a constructor for which we have all of the properties defined
+        for (Constructor constructor : constructors) {
+            ConstructionInfo constructionInfo = new ConstructionInfo(constructor, metadata);
+            if (isUsableConstructor(constructionInfo, definedProperties)) {
+                return constructionInfo;
+            }
+        }
+        return null;
+    }
+
+    private boolean isUsableConstructor(ConstructionInfo constructionInfo, Set definedProperties) {
+        // if we don't have parameter names this is not the constructor we are looking for
+        String[] parameterNames = constructionInfo.parameterNames;
+        if (parameterNames == null) {
+            return false;
+        }
+
+        Class[] parameterTypes = constructionInfo.parameterTypes;
+        for (int i = 0; i < parameterNames.length; i++) {
+            String parameterName = parameterNames[i];
+            Class parameterType = parameterTypes[i];
+
+            // can we satify this property using a defined property or default property
+            if (!definedProperties.contains(parameterName) && !defaultValues.containsKey(new PropertyKey(parameterName, parameterType))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private class ConstructionInfo {
+        private final Class[] parameterTypes;
+        private final String[] parameterNames;
+
+        public ConstructionInfo(Constructor constructor, MappingMetaData metadata) {
+            this.parameterTypes = constructor.getParameterTypes();
+            String[] names = metadata.getParameterNames(constructor);
+
+            // verify that we have enough parameter names
+            int expectedParameterCount = parameterTypes.length;
+            if (names != null && names.length != expectedParameterCount) {
+                throw new ComponentDefinitionException("Excpected " + expectedParameterCount + " parameter names for constructor but only got " +
+                        names.length + ": " + constructor.toString());
+            }
+            if (expectedParameterCount == 0) {
+                names = new String[0];
+            }
+
+            this.parameterNames = names;
+        }
+
+        public ConstructionInfo(Class beanClass, Method factoryMethod, MappingMetaData metadata) {
+            this.parameterTypes = factoryMethod.getParameterTypes();
+
+            String[] names = metadata.getParameterNames(beanClass, factoryMethod);
+
+            // verify that we have enough parameter names
+            int expectedParameterCount = parameterTypes.length;
+            if (names != null && names.length != expectedParameterCount) {
+                throw new ComponentDefinitionException("Excpected " + expectedParameterCount + " parameter names for factory method but only got " +
+                        names.length + ": " + factoryMethod.toString());
+            }
+            if (expectedParameterCount == 0) {
+                names = new String[0];
+            }
+
+            this.parameterNames = names;
+        }
+    }
+
+    private static class MethodArgLengthComparator implements Comparator<Method> {
+        public int compare(Method o1, Method o2) {
+            return getArgLength(o2) - getArgLength(o1);
+        }
+
+        private int getArgLength(Method object) {
+            return object.getParameterTypes().length;
+        }
+    }
+    
+    private static class ConstructorArgLengthComparator implements Comparator<Constructor> {
+        public int compare(Constructor o1, Constructor o2) {
+            return getArgLength(o2) - getArgLength(o1);
+        }
+
+        private int getArgLength(Constructor object) {
+            return object.getParameterTypes().length;
+        }
+    }
+
+    private static class PropertyKey {
+        private final String name;
+        private final Class type;
+
+        public PropertyKey(String name, Class type) {
+            this.name = name;
+            this.type = type;
+        }
+
+        public boolean equals(Object object) {
+            if (!(object instanceof PropertyKey)) {
+                return false;
+            }
+
+            PropertyKey defaultProperty = (PropertyKey) object;
+            return name.equals(defaultProperty.name) && type.equals(type);
+        }
+
+        public int hashCode() {
+            int result = 17;
+            result = 37 * result + name.hashCode();
+            result = 37 * result + type.hashCode();
+            return result;
+        }
+
+        public String toString() {
+            return "[" + name + " " + type + "]";
+        }
+    }
+
+    private static final Map<Class, String> DEFAULT_VALUE;
+
+    static {
+        Map<Class, String> temp = new HashMap<Class, String>();
+        temp.put(Boolean.TYPE, Boolean.FALSE.toString());
+        temp.put(Byte.TYPE, "0B");
+        temp.put(Character.TYPE, "\\u000");
+        temp.put(Short.TYPE, "0S");
+        temp.put(Integer.TYPE, "0");
+        temp.put(Long.TYPE, "0L");
+        temp.put(Float.TYPE, "0F");
+        temp.put(Double.TYPE, "0D");
+
+        DEFAULT_VALUE = Collections.unmodifiableMap(temp);
+    }
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamedConstructorArgs.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,52 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+/**
+ * A helper class for turning namespaces into META-INF/services URIs
+ * 
+ * @version $Revision$
+ */
+public class NamespaceHelper {
+    public static final String META_INF_PREFIX = "META-INF/services/org/apache/xbean/blueprint/";
+
+    /**
+     * Converts the namespace and localName into a valid path name we can use on
+     * the classpath to discover a text file
+     */
+    public static String createDiscoveryPathName(String uri, String localName) {
+        if (isEmpty(uri)) {
+            return localName;
+        }
+        return createDiscoveryPathName(uri) + "/" + localName;
+    }
+
+    /**
+     * Converts the namespace and localName into a valid path name we can use on
+     * the classpath to discover a text file
+     */
+    public static String createDiscoveryPathName(String uri) {
+        // TODO proper encoding required
+        // lets replace any dodgy characters
+        return META_INF_PREFIX + uri.replaceAll("://", "/").replace(':', '/').replace(' ', '_');
+    }
+
+    public static boolean isEmpty(String uri) {
+        return uri == null || uri.length() == 0;
+    }
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/NamespaceHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,43 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import java.beans.PropertyEditorSupport;
+
+/**
+ * Editor for <code>java.net.URI</code>
+ */
+public class ObjectNameEditor extends PropertyEditorSupport {
+
+    public void setAsText(String text) throws IllegalArgumentException {
+        try {
+            setValue(new ObjectName(text));
+        }
+        catch (MalformedObjectNameException e) {
+            throw new IllegalArgumentException("Could not convert ObjectName for " + text + ": " + e.getMessage());
+        }
+    }
+
+    public String getAsText() {
+        ObjectName value = (ObjectName) getValue();
+        return (value != null ? value.toString() : "");
+    }
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/ObjectNameEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,84 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.beans.PropertyEditorManager;
+
+/**
+ * A helper method to register some custom editors
+ * 
+ * @version $Revision$
+ */
+public class PropertyEditorHelper {
+    private static final Log log = LogFactory.getLog(PropertyEditorHelper.class);
+
+    public static void registerCustomEditors() {
+        registerEditor("java.io.File", "org.apache.xbean.blueprint.context.impl.FileEditor");
+        registerEditor("java.net.URI", "org.apache.xbean.blueprint.context.impl.URIEditor");
+        registerEditor("java.util.Date", "org.apache.xbean.blueprint.context.impl.DateEditor");
+        registerEditor("javax.management.ObjectName", "org.apache.xbean.blueprint.context.impl.ObjectNameEditor");
+    }
+
+    protected static void registerEditor(String typeName, String editorName) {
+        Class type = loadClass(typeName);
+        Class editor = loadClass(editorName);
+        if (type != null && editor != null) {
+            PropertyEditorManager.registerEditor(type, editor);
+        }
+    }
+
+    public static void unregisterCustomEditors() {
+        unregisterEditor("java.io.File");
+        unregisterEditor("java.net.URI");
+        unregisterEditor("java.util.Date");
+        unregisterEditor("javax.management.ObjectName");
+    }
+
+    protected static void unregisterEditor(String typeName) {
+        Class type = loadClass(typeName);
+        if (type != null) {
+            PropertyEditorManager.registerEditor(type, null);
+        }
+    }
+    public static Class loadClass(String name) {
+        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+        if (contextClassLoader != null) {
+            try {
+                return contextClassLoader.loadClass(name);
+            }
+            catch (ClassNotFoundException e) {
+            }
+            catch (NoClassDefFoundError e) {
+            }
+        }
+        try {
+            return PropertyEditorHelper.class.getClassLoader().loadClass(name);
+        }
+        catch (ClassNotFoundException e) {
+            log.debug("Could not find class: " + name + " on the classpath");
+            return null;
+        }
+        catch (NoClassDefFoundError e) {
+            log.debug("Could not load class: " + name + " on the classpath. " + e.getMessage());
+            return null;
+        }
+    }
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/PropertyEditorHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,43 @@
+/**
+ * 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.xbean.blueprint.context.impl;
+
+import java.beans.PropertyEditorSupport;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * Editor for <code>java.net.URI</code>
+ */
+public class URIEditor extends PropertyEditorSupport {
+
+	public void setAsText(String text) throws IllegalArgumentException {
+		try {
+            setValue(new URI(text));
+		}
+        catch (URISyntaxException e) {
+            throw new IllegalArgumentException(
+                    "Could not convert URI for " + text + ": " + e.getMessage());
+        }
+	}
+
+	public String getAsText() {
+		URI value = (URI) getValue();
+		return (value != null ? value.toString() : "");
+	}
+
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/URIEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,215 @@
+/*
+ * 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.xbean.blueprint.context.impl;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutableValueMetadata;
+import org.apache.aries.blueprint.reflect.BeanPropertyImpl;
+import org.osgi.framework.Bundle;
+import org.osgi.service.blueprint.container.ComponentDefinitionException;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+import org.osgi.service.blueprint.reflect.CollectionMetadata;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.HashMap;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class XBeanNamespaceHandler implements NamespaceHandler {
+
+    private final String namespace;
+    private final URL schemaLocation;
+    private final Set<Class> managedClasses;
+    private final MappingMetaData mappingMetaData;
+    private final Map<String, Class> managedClassesByName;
+    private final NamedConstructorArgs namedConstructorArgs = new NamedConstructorArgs();
+
+    public XBeanNamespaceHandler(String namespace, URL schemaLocation, Set<Class> managedClasses, Properties properties) {
+        this.namespace = namespace;
+        this.schemaLocation = schemaLocation;
+        this.managedClasses = managedClasses;
+        managedClassesByName = mapClasses(managedClasses);
+        this.mappingMetaData = new MappingMetaData(properties);
+    }
+
+    public XBeanNamespaceHandler(String namespace, String schemaLocation, Bundle bundle, String propertiesLocation) throws IOException, ClassNotFoundException {
+        this.namespace = namespace;
+        this.schemaLocation = bundle.getEntry(schemaLocation);
+        URL propertiesUrl = bundle.getEntry(propertiesLocation);
+        InputStream in = propertiesUrl.openStream();
+        Properties properties = new Properties();
+        try {
+            properties.load(in);
+        } finally {
+            in.close();
+        }
+        managedClasses = new HashSet<Class>();
+        for (Map.Entry entry : properties.entrySet()) {
+            String key = (String) entry.getKey();
+            if (key.indexOf(".") < 0) {
+                String className = (String) entry.getValue();
+                Class clazz = bundle.loadClass(className);
+                managedClasses.add(clazz);
+            }
+        }
+        managedClassesByName = mapClasses(managedClasses);
+        this.mappingMetaData = new MappingMetaData(properties);
+    }
+
+    private Map<String, Class> mapClasses(Set<Class> managedClasses) {
+        Map<String, Class> map = new HashMap<String, Class>();
+        for (Class clazz : managedClasses) {
+            map.put(clazz.getName(), clazz);
+        }
+        return map;
+    }
+
+    public URL getSchemaLocation(String s) {
+        if (namespace.equals(s)) {
+            return schemaLocation;
+        }
+        return null;
+    }
+
+    public Set<Class> getManagedClasses() {
+        return managedClasses;
+    }
+
+    public Metadata parse(Element element, ParserContext parserContext) {
+        String beanTypeName = element.getLocalName();
+        String className = mappingMetaData.getClassName(beanTypeName);
+        if (className == null) {
+            throw new ComponentDefinitionException(beanTypeName + " not known to xbean namespace handler for " + namespace);
+        }
+        MutableBeanMetadata beanMetaData = parserContext.createMetadata(MutableBeanMetadata.class);
+        beanMetaData.setClassName(className);
+        beanMetaData.setRuntimeClass(managedClassesByName.get(className));
+        if (beanMetaData.getRuntimeClass() == null) {
+            throw new ComponentDefinitionException("Unknown bean class: " + className);
+        }
+
+        if (element.hasAttributeNS("http://www.osgi.org/xmlns/blueprint/v1.0.0", "id")) {
+            String id = element.getAttributeNS("http://www.osgi.org/xmlns/blueprint/v1.0.0", "id");
+            beanMetaData.setId(id);
+        } else {
+            beanMetaData.setId(parserContext.generateId());
+        }
+
+        String initMethod = mappingMetaData.getInitMethodName(beanTypeName);
+        if (initMethod != null) {
+            beanMetaData.setInitMethod(initMethod);
+        }
+        String destroyMethod = mappingMetaData.getDestroyMethodName(beanTypeName);
+        if (destroyMethod != null) {
+            beanMetaData.setDestroyMethod(destroyMethod);
+        }
+        String factoryMethod = mappingMetaData.getFactoryMethodName(beanTypeName);
+        if (factoryMethod != null) {
+            beanMetaData.setFactoryMethod(factoryMethod);
+        }
+
+        NamedNodeMap attrs = element.getAttributes();
+        for (int i = 0; i < attrs.getLength(); i++) {
+            Attr attr = (Attr) attrs.item(i);
+            if (namespace.equals(attr.getNamespaceURI())) {
+                String attrName = attr.getLocalName();
+                String value = attr.getValue().trim();
+                String propertyName = mappingMetaData.getPropertyName(beanTypeName, attrName);
+                MutableValueMetadata m = parserContext.createMetadata(MutableValueMetadata.class);
+                m.setStringValue(value);
+//            m.setType(null);
+                BeanProperty beanProperty = new BeanPropertyImpl(propertyName, m);
+                beanMetaData.addProperty(beanProperty);
+            }
+        }
+
+        NodeList nodes = element.getChildNodes();
+        for (int i = 0; i < nodes.getLength(); i++) {
+            Node node = nodes.item(i);
+            if (node instanceof Element) {
+                Element child = (Element) node;
+                String childName = child.getLocalName();
+                Metadata childMetadata = null;
+                String propertyName = mappingMetaData.getNestedListProperty(beanTypeName, childName);
+                //explicit list?
+                if (propertyName != null) {
+                    childMetadata = parserContext.parseElement(CollectionMetadata.class, beanMetaData, child);
+                } else if ((propertyName = mappingMetaData.getFlatCollectionProperty(beanTypeName, childName)) != null) {
+
+//                } else if ((propertyName = mappingMetaData.getNestedProperty(beanTypeName, childName)) != null) {
+//
+//                } else if ((propertyName = mappingMetaData.get))
+                } else {
+                    propertyName = mappingMetaData.getPropertyName(beanTypeName, childName);
+                    NodeList childNodes = child.getChildNodes();
+                    StringBuilder buf = new StringBuilder();
+                    for (int j = 0; j < childNodes.getLength(); j++) {
+                        Node childNode = childNodes.item(j);
+                        if (childNode instanceof Element) {
+                            Element childElement = (Element) childNode;
+                            try {
+                                childMetadata = parserContext.parseElement(BeanMetadata.class, beanMetaData, (Element) childNode);
+                            } catch (Exception e) {
+                                childMetadata = parserContext.parseElement(ValueMetadata.class, beanMetaData, childElement);
+                            }
+                            break;
+                        } else if (childNode instanceof Text) {
+                            String value = childNode.getNodeValue();
+                            buf.append(value);
+                        }
+                    }
+                    if (childMetadata == null) {
+                        MutableValueMetadata m = parserContext.createMetadata(MutableValueMetadata.class);
+                        m.setStringValue(buf.toString().trim());
+                        childMetadata = m;
+                    }
+                }
+                BeanProperty beanProperty = new BeanPropertyImpl(propertyName, childMetadata);
+                beanMetaData.addProperty(beanProperty);
+            }
+        }
+        namedConstructorArgs.processParameters(beanMetaData, mappingMetaData, parserContext);
+        return beanMetaData;
+    }
+
+    public ComponentMetadata decorate(Node node, ComponentMetadata componentMetadata, ParserContext parserContext) {
+        return componentMetadata;
+    }
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/context/impl/XBeanNamespaceHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java?rev=896187&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java (added)
+++ geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java Tue Jan  5 19:31:05 2010
@@ -0,0 +1,95 @@
+/**
+ * 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.xbean.blueprint.generator;
+
+/**
+ * @author Dain Sundstrom
+ * @version $Id$
+ * @since 1.0
+ */
+public class AttributeMapping implements Comparable {
+    private final String attributeName;
+    private final String propertyName;
+    private final String description;
+    private final Type type;
+    private final String value;
+    private final boolean fixed;
+    private final boolean required;
+	private final String propertyEditor;
+
+    public AttributeMapping(String attributeName, String propertyName, String description, Type type, String value, boolean fixed, boolean required, String propertyEditor) {
+        this.propertyEditor = propertyEditor;
+		if (attributeName == null) throw new NullPointerException("attributeName");
+        if (propertyName == null) throw new NullPointerException("propertyName");
+        if (type == null) throw new NullPointerException("type");
+        this.attributeName = attributeName;
+        this.propertyName = propertyName;
+        if (description == null) description = "";
+        this.description = description;
+        this.type = type;
+        this.value = value;
+        this.fixed = fixed;
+        this.required = required;
+    }
+
+    public String getAttributeName() {
+        return attributeName;
+    }
+
+    public String getPropertyName() {
+        return propertyName;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public boolean isFixed() {
+        return fixed;
+    }
+
+    public boolean isRequired() {
+        return required;
+    }
+
+    public int hashCode() {
+        return attributeName.hashCode();
+    }
+
+    public boolean equals(Object obj) {
+        if (obj instanceof AttributeMapping) {
+            return attributeName.equals(((AttributeMapping) obj).attributeName);
+        }
+        return false;
+    }
+
+    public int compareTo(Object obj) {
+        return attributeName.compareTo(((AttributeMapping) obj).attributeName);
+    }
+
+	public String getPropertyEditor() {
+		return propertyEditor;
+	}
+}

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/xbean/trunk/xbean-blueprint/src/main/java/org/apache/xbean/blueprint/generator/AttributeMapping.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message