jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1298932 - /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
Date Fri, 09 Mar 2012 17:26:07 GMT
Author: mduerig
Date: Fri Mar  9 17:26:07 2012
New Revision: 1298932

URL: http://svn.apache.org/viewvc?rev=1298932&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- filter iterators against correct state

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java?rev=1298932&r1=1298931&r2=1298932&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
Fri Mar  9 17:26:07 2012
@@ -98,13 +98,14 @@ public class TransientNodeState {
 
     public Iterator<TransientNodeState> getChildNodeStates() {
         Map<String, JsonValue> childEntries = getJsonObject().value();
+        final NodeDelta delta = getNodeDelta();
 
         Iterator<Entry<String, JsonValue>> childNodeEntries =
             Iterators.filterIterator(childEntries.entrySet().iterator(),
                     new Predicate<Entry<String, JsonValue>>() {
                         @Override
                         public boolean evaluate(Entry<String, JsonValue> entry) {
-                            return isNode(entry.getValue()) && !getNodeDelta().isNodeModified(entry.getKey());
+                            return isNode(entry.getValue()) && !delta.isNodeModified(entry.getKey());
                         }
                     });
 
@@ -112,17 +113,17 @@ public class TransientNodeState {
             new Transformer<Entry<String, JsonValue>, TransientNodeState>() {
                 @Override
                 public TransientNodeState transform(Entry<String, JsonValue> entry)
{
-                    return getNodeState(sessionContext, getNodeDelta().getNode(entry.getKey()));
+                    return getNodeState(sessionContext, delta.getNode(entry.getKey()));
                 }
         });
 
-        Iterator<TransientNodeState> modifiedNodeStates = Iterators.transformIterator(getNodeDelta().getNodes(),
-            new Transformer<NodeDelta, TransientNodeState>() {
-                @Override
-                public TransientNodeState transform(NodeDelta delta) {
-                    return getNodeState(sessionContext, delta);
-                }
-        });
+        Iterator<TransientNodeState> modifiedNodeStates = Iterators.transformIterator(delta.getNodes(),
+                new Transformer<NodeDelta, TransientNodeState>() {
+                    @Override
+                    public TransientNodeState transform(NodeDelta delta) {
+                        return getNodeState(sessionContext, delta);
+                    }
+                });
 
         return Iterators.iteratorChain(childNodeStates, modifiedNodeStates);
     }
@@ -137,6 +138,7 @@ public class TransientNodeState {
 
     public Iterator<Entry<String, JsonValue>> getProperties() {
         Map<String, JsonValue> childEntries = getJsonObject().value();
+        final NodeDelta delta = getNodeDelta();
 
         Iterator<Entry<String, JsonValue>> propertyEntries =
             Iterators.filterIterator(childEntries.entrySet().iterator(),
@@ -144,11 +146,11 @@ public class TransientNodeState {
                         @Override
                         public boolean evaluate(Entry<String, JsonValue> entry) {
                             return !entry.getKey().startsWith(":") && !isNode(entry.getValue())
-                                    && !getNodeDelta().hasProperty(entry.getKey());
+                                    && !delta.hasProperty(entry.getKey());
                         }
                     });
 
-        return Iterators.iteratorChain(propertyEntries, getNodeDelta().getProperties());
+        return Iterators.iteratorChain(propertyEntries, delta.getProperties());
     }
 
     public Iterator<Entry<String, JsonValue>> getProperties(Predicate<Entry<String,
JsonValue>> condition) {



Mime
View raw message