incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apope...@apache.org
Subject svn commit: r376038 - in /incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper: impl/DigesterMapperImpl.java model/BeanDescriptor.java model/ClassDescriptor.java model/MappingDescriptor.java
Date Wed, 08 Feb 2006 20:04:26 GMT
Author: apopescu
Date: Wed Feb  8 12:04:24 2006
New Revision: 376038

URL: http://svn.apache.org/viewcvs?rev=376038&view=rev
Log:
mapping model is fully navigational

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

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=376038&r1=376037&r2=376038&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
Wed Feb  8 12:04:24 2006
@@ -123,6 +123,7 @@
         if (this.mappingFiles != null && this.mappingFiles.length > 0) {
             log.info("Read the xml mapping file : " +  this.mappingFiles[0]);
             this.mappingDescriptor = this.descriptorReader.loadClassDescriptors(this.mappingFiles[0]);
+            this.mappingDescriptor.setMapper(this);
 
             for (int i = 1; i < this.mappingFiles.length; i++) {
                 log.info("Read the xml mapping file : " +  this.mappingFiles[i]);
@@ -133,6 +134,7 @@
         else if (this.mappingStreams != null && this.mappingStreams.length > 0)
{
             log.info("Read the stream mapping file : " +  this.mappingStreams[0].toString());
             this.mappingDescriptor = this.descriptorReader.loadClassDescriptors(this.mappingStreams[0]);
+            this.mappingDescriptor.setMapper(this);
 
             for (int i = 1; i < this.mappingStreams.length; i++) {
                 log.info("Read the stream mapping file : " +  this.mappingStreams[i].toString());

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java?rev=376038&r1=376037&r2=376038&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
Wed Feb  8 12:04:24 2006
@@ -27,6 +27,8 @@
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
 public class BeanDescriptor {
+    private ClassDescriptor classDescriptor;
+    
     private String fieldName;
     private String jcrName;
     private boolean proxy;
@@ -222,5 +224,19 @@
      */
     public void setJcrSameNameSiblings(boolean value) {
         this.jcrSameNameSiblings = value;
+    }
+
+    /**
+     * @param descriptor
+     */
+    public void setClassDescriptor(ClassDescriptor descriptor) {
+        this.classDescriptor = descriptor;
+    }
+
+    /**
+     * @return Returns the classDescriptor.
+     */
+    public ClassDescriptor getClassDescriptor() {
+        return classDescriptor;
     }
 }

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java?rev=376038&r1=376037&r2=376038&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
Wed Feb  8 12:04:24 2006
@@ -18,6 +18,7 @@
 
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  *
@@ -27,6 +28,8 @@
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
 public class ClassDescriptor {
+    private MappingDescriptor mappingDescriptor;
+    
     private String className;
     private String jcrNodeType;
     private String jcrSuperTypes;
@@ -34,10 +37,10 @@
     private FieldDescriptor idFieldDescriptor;
     private FieldDescriptor pathFieldDescriptor;
 
-    private HashMap fieldDescriptors = new HashMap();
-    private HashMap beanDescriptors = new HashMap();
-    private HashMap collectionDescriptors = new HashMap();
-    private HashMap fieldNames = new HashMap();
+    private Map fieldDescriptors = new HashMap();
+    private Map beanDescriptors = new HashMap();
+    private Map collectionDescriptors = new HashMap();
+    private Map fieldNames = new HashMap();
 
     /**
      * @return Returns the className.
@@ -109,6 +112,7 @@
      */
 
     public void addBeanDescriptor(BeanDescriptor beanDescriptor) {
+        beanDescriptor.setClassDescriptor(this);
         beanDescriptors.put(beanDescriptor.getFieldName(), beanDescriptor);
         fieldNames.put(beanDescriptor.getFieldName(), beanDescriptor.getJcrName());
     }
@@ -227,5 +231,19 @@
 
     public void setJcrMixinTypes(String[] mixinTypes) {
         jcrMixinTypes = mixinTypes;
+    }
+
+    /**
+     * @return Returns the mappingDescriptor.
+     */
+    public MappingDescriptor getMappingDescriptor() {
+        return mappingDescriptor;
+    }
+
+    /**
+     * @param mappingDescriptor The mappingDescriptor to set.
+     */
+    public void setMappingDescriptor(MappingDescriptor mappingDescriptor) {
+        this.mappingDescriptor = mappingDescriptor;
     }
 }

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java?rev=376038&r1=376037&r2=376038&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
Wed Feb  8 12:04:24 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 2000-2005 The Apache Software Foundation.
- * 
+ *
  * Licensed 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.
@@ -15,47 +15,56 @@
  */
 package org.apache.portals.graffito.jcr.mapper.model;
 
+
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.portals.graffito.jcr.mapper.Mapper;
+
 /**
  * This class match to the complete xml mapping files.
  * it contains mainly a collection of {@link ClassDescriptor}
- * 
+ *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
  */
-public class MappingDescriptor
-{
+public class MappingDescriptor {
     private HashMap classDescriptors = new HashMap();
-    
+
+    private Mapper mapper;
+
     /**
      * Add a new ClassDescriptor
-     * 
+     *
      * @param classDescriptor The class descriptor to add
      */
-    public void addClassDescriptor(ClassDescriptor classDescriptor)
-    {
+    public void addClassDescriptor(ClassDescriptor classDescriptor) {
         classDescriptors.put(classDescriptor.getClassName(), classDescriptor);
+        classDescriptor.setMappingDescriptor(this);
     }
-    
+
     /**
-     * Get the classdescriptor to used for the class 
-     * @param className the class name 
+     * Get the classdescriptor to used for the class
+     * @param className the class name
      * @return the class descriptor found or null
      */
-    public ClassDescriptor getClassDescriptor(String className)
-    {
+    public ClassDescriptor getClassDescriptor(String className) {
         return (ClassDescriptor) classDescriptors.get(className);
     }
-    
+
     /**
-     * Get all class descriptors 
+     * Get all class descriptors
      * @return all class descriptors found
      */
-    public Map getClassDescriptors()
-    {
-    	return classDescriptors;
+    public Map getClassDescriptors() {
+        return classDescriptors;
+    }
+
+    public Mapper getMapper() {
+        return this.mapper;
     }
 
+    public void setMapper(Mapper parentMapper) {
+        this.mapper = parentMapper;
+    }
 }



Mime
View raw message