incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r315034 - in /incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper: impl/DigesterMapperImpl.java model/MappingDescriptor.java
Date Wed, 12 Oct 2005 20:35:08 GMT
Author: clombart
Date: Wed Oct 12 13:35:02 2005
New Revision: 315034

URL: http://svn.apache.org/viewcvs?rev=315034&view=rev
Log:
Support multiple mapping files : GRFT-48

Modified:
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=315034&r1=315033&r2=315034&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
Wed Oct 12 13:35:02 2005
@@ -48,12 +48,31 @@
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(xmlFile);
     }
     
+    public DigesterMapperImpl(String[] files) throws JcrMappingException
+    {
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[0]);
+        for (int i=1; i<files.length;i++)
+        {
+            MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[i]);
+            mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
+        }
+    }
+    
     public DigesterMapperImpl(InputStream stream) throws JcrMappingException
     {
         log.info("Read the input stream : " +  stream);
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(stream);
     }
 
+    public DigesterMapperImpl(InputStream[] streams) throws JcrMappingException
+    {
+        mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[0]);
+        for (int i=1; i<streams.length;i++)
+        {
+            MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[i]);
+            mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
+        }
+    }
 
     /**
      * 

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java?rev=315034&r1=315033&r2=315034&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
Wed Oct 12 13:35:02 2005
@@ -16,6 +16,7 @@
 package org.apache.portals.graffito.jcr.mapper.model;
 
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * This class match to the complete xml mapping files.
@@ -36,6 +37,11 @@
     public ClassDescriptor getClassDescriptor(String className)
     {
         return (ClassDescriptor) classDescriptors.get(className);
+    }
+    
+    public Map getClassDescriptors()
+    {
+    	return classDescriptors;
     }
 
 }



Mime
View raw message