jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1335580 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
Date Tue, 08 May 2012 15:20:07 GMT
Author: reschke
Date: Tue May  8 15:20:06 2012
New Revision: 1335580

URL: http://svn.apache.org/viewvc?rev=1335580&view=rev
Log:
OAK-66: refactor classes into session-aware parts and core parts (WIP)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java?rev=1335580&r1=1335579&r2=1335580&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
Tue May  8 15:20:06 2012
@@ -47,6 +47,7 @@ import org.apache.jackrabbit.commons.cnd
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.apache.jackrabbit.commons.iterator.NodeTypeIteratorAdapter;
 import org.apache.jackrabbit.oak.api.CoreValue;
+import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.jcr.value.ValueFactoryImpl;
 import org.apache.jackrabbit.oak.namepath.NameMapper;
 
@@ -259,11 +260,12 @@ public class NodeTypeManagerImpl impleme
                     .size()]), primaryItemName, isMixin, isAbstract, isOrderable);
 
             for (PropertyDefinitionBuilderImpl pdb : propertyDefinitions) {
-                result.addPropertyDefinition(pdb.getPropertyDefinition(result, vf, mapper));
+                result.addPropertyDefinition(new PropertyDefinitionImpl(result, mapper, vf,
pdb.getPropertyDefinitionDelegate(vf
+                        .getCoreValueFactory())));
             }
 
             for (NodeDefinitionBuilderImpl ndb : childNodeDefinitions) {
-                result.addChildNodeDefinition(ndb.getNodeDefinition(ntm, result, mapper));
+                result.addChildNodeDefinition(new NodeDefinitionImpl(ntm, result, mapper,
ndb.getNodeDefinitionDelegate()));
             }
 
             return result;
@@ -290,10 +292,9 @@ public class NodeTypeManagerImpl impleme
             this.ndtb = ntdb;
         }
 
-        public NodeDefinition getNodeDefinition(NodeTypeManager ntm, NodeType nt, NameMapper
mapper) {
-            return new NodeDefinitionImpl(ntm, nt, mapper, new NodeDefinitionDelegate(name,
autocreate, isMandatory, onParent,
-                    isProtected, requiredPrimaryTypes.toArray(new String[requiredPrimaryTypes.size()]),
defaultPrimaryType,
-                    allowSns));
+        public NodeDefinitionDelegate getNodeDefinitionDelegate() {
+            return new NodeDefinitionDelegate(name, autocreate, isMandatory, onParent, isProtected,
+                    requiredPrimaryTypes.toArray(new String[requiredPrimaryTypes.size()]),
defaultPrimaryType, allowSns);
         };
 
         @Override
@@ -329,16 +330,16 @@ public class NodeTypeManagerImpl impleme
             this.ndtb = ntdb;
         }
 
-        public PropertyDefinition getPropertyDefinition(NodeType nt, ValueFactoryImpl vf,
NameMapper mapper) {
-            
+        public PropertyDefinitionDelegate getPropertyDefinitionDelegate(CoreValueFactory
cvf) {
+
             CoreValue[] defaultCoreValues = new CoreValue[defaultValues.size()];
-            
+
             for (int i = 0; i < defaultCoreValues.length; i++) {
-                defaultCoreValues[i] = vf.getCoreValueFactory().createValue(defaultValues.get(i),
requiredType);
+                defaultCoreValues[i] = cvf.createValue(defaultValues.get(i), requiredType);
             }
-            
-            return new PropertyDefinitionImpl(nt, mapper, vf, new PropertyDefinitionDelegate(name,
autocreate, isMandatory,
-                    onParent, isProtected, requiredType, isMultiple, defaultCoreValues));
+
+            return new PropertyDefinitionDelegate(name, autocreate, isMandatory, onParent,
isProtected, requiredType, isMultiple,
+                    defaultCoreValues);
         }
 
         @Override



Mime
View raw message