jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1397360 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/ oak-core/src...
Date Thu, 11 Oct 2012 23:08:42 GMT
Author: mduerig
Date: Thu Oct 11 23:08:40 2012
New Revision: 1397360

URL: http://svn.apache.org/viewvc?rev=1397360&view=rev
Log:
OAK-371 Query package refactoring
- Refactor ValueFactoryImpl to use PropertyValue instead of CoreValue
- Move PropertyValue to package value

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java   (contents, props changed)
      - copied, changed from r1397264, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java   (contents, props changed)
      - copied, changed from r1397264, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/CoreValues.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ResultRow.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/SessionQueryEngine.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SessionQueryEngineImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/IndexRowImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexRow.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/BinaryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueFactoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ResultRow.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ResultRow.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ResultRow.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ResultRow.java Thu Oct 11 23:08:40 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.oak.api;
 
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A query result row.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/SessionQueryEngine.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/SessionQueryEngine.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/SessionQueryEngine.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/SessionQueryEngine.java Thu Oct 11 23:08:40 2012
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * The query engine allows to parse and execute queries.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/IdentifierManager.java Thu Oct 11 23:08:40 2012
@@ -42,8 +42,8 @@ import org.apache.jackrabbit.oak.api.Typ
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/PropertyContentIndex.java Thu Oct 11 23:08:40 2012
@@ -25,7 +25,7 @@ import org.apache.jackrabbit.oak.query.i
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexLookup.java Thu Oct 11 23:08:40 2012
@@ -20,8 +20,8 @@ import java.util.Set;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/SinglePropertyState.java Thu Oct 11 23:08:40 2012
@@ -61,7 +61,7 @@ abstract class SinglePropertyState exten
     }
 
     protected boolean getBoolean() {
-        throw new UnsupportedOperationException("Unsupported conversion.");
+        return Boolean.parseBoolean(getString());
     }
 
     protected BigDecimal getDecimal() {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java Thu Oct 11 23:08:40 2012
@@ -49,8 +49,8 @@ import org.apache.jackrabbit.oak.query.a
 import org.apache.jackrabbit.oak.query.ast.SourceImpl;
 import org.apache.jackrabbit.oak.query.ast.UpperCaseImpl;
 import org.apache.jackrabbit.oak.spi.query.Filter;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngineImpl.java Thu Oct 11 23:08:40 2012
@@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.query.index.TraversingIndex;
 import org.apache.jackrabbit.oak.spi.query.Filter;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ResultRowImpl.java Thu Oct 11 23:08:40 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.query;
 import org.apache.jackrabbit.oak.api.ResultRow;
 import org.apache.jackrabbit.oak.query.ast.ColumnImpl;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A query result row that keeps all data in memory.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java Thu Oct 11 23:08:40 2012
@@ -33,8 +33,8 @@ import org.apache.jackrabbit.oak.query.a
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.query.ast.SourceImpl;
 import org.apache.jackrabbit.oak.query.ast.StaticOperandImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 import javax.jcr.PropertyType;
 import java.math.BigDecimal;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SessionQueryEngineImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SessionQueryEngineImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SessionQueryEngineImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SessionQueryEngineImpl.java Thu Oct 11 23:08:40 2012
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.oak.api.Res
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.SessionQueryEngine;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java Thu Oct 11 23:08:40 2012
@@ -13,7 +13,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A factory for syntax tree elements.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java Thu Oct 11 23:08:40 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A bind variable.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java Thu Oct 11 23:08:40 2012
@@ -18,8 +18,8 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * A result column expression.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java Thu Oct 11 23:08:40 2012
@@ -20,8 +20,8 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * A comparison operation (including "like").

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java Thu Oct 11 23:08:40 2012
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * The base class for dynamic operands (such as a function or property).

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java Thu Oct 11 23:08:40 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * The "a.x = b.y" join condition.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchImpl.java Thu Oct 11 23:08:40 2012
@@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.query.ast.ComparisonImpl.LikePattern;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 import static org.apache.jackrabbit.oak.api.Type.STRINGS;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java Thu Oct 11 23:08:40 2012
@@ -20,8 +20,8 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.oak.query.Query;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * A fulltext search score expression.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java Thu Oct 11 23:08:40 2012
@@ -21,8 +21,8 @@ package org.apache.jackrabbit.oak.query.
 import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * The function "length(..)".

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java Thu Oct 11 23:08:40 2012
@@ -24,7 +24,7 @@ import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.query.SQL2Parser;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A literal of a certain data type, possibly "cast(..)" of a literal.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java Thu Oct 11 23:08:40 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java Thu Oct 11 23:08:40 2012
@@ -20,8 +20,8 @@ package org.apache.jackrabbit.oak.query.
 
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.util.ISO9075;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java Thu Oct 11 23:08:40 2012
@@ -23,8 +23,8 @@ import javax.jcr.PropertyType;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.util.ISO9075;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java Thu Oct 11 23:08:40 2012
@@ -30,8 +30,8 @@ import org.apache.jackrabbit.oak.api.Typ
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.query.SQL2Parser;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 import com.google.common.collect.Iterables;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java Thu Oct 11 23:08:40 2012
@@ -37,8 +37,8 @@ import org.apache.jackrabbit.oak.query.i
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java Thu Oct 11 23:08:40 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * The base class for static operands (literal, bind variables).

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java Thu Oct 11 23:08:40 2012
@@ -19,8 +19,8 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/FilterImpl.java Thu Oct 11 23:08:40 2012
@@ -30,7 +30,7 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 import org.apache.jackrabbit.oak.spi.query.Filter;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A filter or lookup condition.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/IndexRowImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/IndexRowImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/IndexRowImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/IndexRowImpl.java Thu Oct 11 23:08:40 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.index;
 
 import org.apache.jackrabbit.oak.spi.query.IndexRow;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * A simple index row implementation.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProviderImpl.java Thu Oct 11 23:08:40 2012
@@ -37,7 +37,7 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider;
 import org.apache.jackrabbit.oak.spi.security.principal.TreeBasedPrincipal;
 import org.apache.jackrabbit.oak.spi.security.user.AuthorizableType;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Filter.java Thu Oct 11 23:08:40 2012
@@ -21,6 +21,8 @@ package org.apache.jackrabbit.oak.spi.qu
 import java.util.Collection;
 import javax.jcr.PropertyType;
 
+import org.apache.jackrabbit.oak.value.PropertyValue;
+
 /**
  * The filter for an index lookup.
  */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexRow.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexRow.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexRow.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexRow.java Thu Oct 11 23:08:40 2012
@@ -19,6 +19,8 @@
 package org.apache.jackrabbit.oak.spi.query;
 
 
+import org.apache.jackrabbit.oak.value.PropertyValue;
+
 /**
  * A row returned by the index.
  */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/BinaryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/BinaryImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/BinaryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/BinaryImpl.java Thu Oct 11 23:08:40 2012
@@ -50,13 +50,13 @@ class BinaryImpl implements Binary {
                     throw new RepositoryException(e.getMessage());
                 }
             default:
-                return value.unwrap().getNewStream();
+                return value.getNewStream();
         }
     }
 
     @Override
     public int read(byte[] b, long position) throws IOException, RepositoryException {
-        InputStream stream = value.unwrap().getNewStream();
+        InputStream stream = value.getNewStream();
         try {
             if (position != stream.skip(position)) {
                 throw new IOException("Can't skip to position " + position);
@@ -75,7 +75,7 @@ class BinaryImpl implements Binary {
                 // need to respect namespace remapping
                 return value.getString().length();
             default:
-                return value.unwrap().length();
+                return value.getStreamLength();
         }
     }
 

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java (from r1397264, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java&r1=1397264&r2=1397360&rev=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValue.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java Thu Oct 11 23:08:40 2012
@@ -16,13 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.spi.query;
+package org.apache.jackrabbit.oak.value;
 
+import java.math.BigDecimal;
 import java.util.Calendar;
 import java.util.Iterator;
+import java.util.List;
 
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
 import javax.jcr.PropertyType;
 
+import com.google.common.collect.Lists;
+import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.util.ISO8601;
@@ -39,18 +45,92 @@ public class PropertyValue implements Co
         return ps.isArray();
     }
 
+    @Nonnull
     public Type<?> getType() {
         return ps.getType();
     }
 
+    @Nonnull
     public <T> T getValue(Type<T> type) {
         return ps.getValue(type);
     }
 
+    @Nonnull
     public <T> T getValue(Type<T> type, int index) {
         return ps.getValue(type, index);
     }
 
+    public List<PropertyValue> values() {
+        List<PropertyValue> pvs = Lists.newArrayList();
+
+        int type = getType().tag();
+        switch (type) {
+            case PropertyType.STRING:
+                for (String value : getValue(Type.STRINGS)) {
+                    pvs.add(PropertyValues.newString(value));
+                }
+                break;
+            case PropertyType.BINARY:
+                for (Blob value : getValue(Type.BINARIES)) {
+                    pvs.add(PropertyValues.newBinary(value));
+                }
+                break;
+            case PropertyType.LONG:
+                for (Long value : getValue(Type.LONGS)) {
+                    pvs.add(PropertyValues.newLong(value));
+                }
+                break;
+            case PropertyType.DOUBLE:
+                for (Double value : getValue(Type.DOUBLES)) {
+                    pvs.add(PropertyValues.newDouble(value));
+                }
+                break;
+            case PropertyType.DATE:
+                for (String value : getValue(Type.DATES)) {
+                    pvs.add(PropertyValues.newDate(value));
+                }
+                break;
+            case PropertyType.BOOLEAN:
+                for (Boolean value : getValue(Type.BOOLEANS)) {
+                    pvs.add(PropertyValues.newBoolean(value));
+                }
+                break;
+            case PropertyType.NAME:
+                for (String value : getValue(Type.NAMES)) {
+                    pvs.add(PropertyValues.newName(value));
+                }
+                break;
+            case PropertyType.PATH:
+                for (String value : getValue(Type.PATHS)) {
+                    pvs.add(PropertyValues.newPath(value));
+                }
+                break;
+            case PropertyType.REFERENCE:
+                for (String value : getValue(Type.REFERENCES)) {
+                    pvs.add(PropertyValues.newReference(value));
+                }
+                break;
+            case PropertyType.WEAKREFERENCE:
+                for (String value : getValue(Type.WEAKREFERENCES)) {
+                    pvs.add(PropertyValues.newWeakReference(value));
+                }
+                break;
+            case PropertyType.URI:
+                for (String value : getValue(Type.URIS)) {
+                    pvs.add(PropertyValues.newUri(value));
+                }
+                break;
+            case PropertyType.DECIMAL:
+                for (BigDecimal value : getValue(Type.DECIMALS)) {
+                    pvs.add(PropertyValues.newDecimal(value));
+                }
+                break;
+            default:
+                throw new IllegalStateException("Invalid type: " + getType());
+        }
+        return pvs;
+    }
+
     public long size() {
         return ps.size();
     }
@@ -63,10 +143,12 @@ public class PropertyValue implements Co
         return ps.count();
     }
 
+    @CheckForNull
     public PropertyState unwrap() {
         return ps;
     }
 
+    @Override
     public int compareTo(PropertyValue p2) {
         if (getType().tag() != p2.getType().tag()) {
             return Integer.signum(getType().tag() - p2.getType().tag());

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValue.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java (from r1397264, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java&r1=1397264&r2=1397360&rev=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/PropertyValues.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java Thu Oct 11 23:08:40 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.spi.query;
+package org.apache.jackrabbit.oak.value;
 
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -26,6 +26,7 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.jcr.PropertyType;
 
+import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
@@ -112,6 +113,11 @@ public class PropertyValues {
         return new PropertyValue(PropertyStates.binaryProperty("", value));
     }
 
+    @Nonnull
+    public static PropertyValue newBinary(Blob value) {
+        return new PropertyValue(PropertyStates.binaryProperty("", value));
+    }
+
     // --
 
     public static boolean match(PropertyValue p1, PropertyState p2) {

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/PropertyValues.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueFactoryImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueFactoryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueFactoryImpl.java Thu Oct 11 23:08:40 2012
@@ -16,11 +16,12 @@
  */
 package org.apache.jackrabbit.oak.value;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Calendar;
 import java.util.List;
 
@@ -33,127 +34,98 @@ import javax.jcr.ValueFactory;
 import javax.jcr.ValueFormatException;
 
 import com.google.common.collect.Lists;
-import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
+import com.google.common.io.ByteStreams;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager;
-import org.apache.jackrabbit.oak.plugins.memory.CoreValues;
+import org.apache.jackrabbit.oak.plugins.memory.StringPropertyState;
 import org.apache.jackrabbit.util.ISO8601;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Implementation of {@link ValueFactory} interface based on the
- * {@link CoreValueFactory} exposed by the
- * {@link org.apache.jackrabbit.oak.api.ContentSession#getCoreValueFactory()}
- * being aware of namespaces remapped on the editing session.
+ * Implementation of {@link ValueFactory} interface.
  */
 public class ValueFactoryImpl implements ValueFactory {
-
-    /**
-     * logger instance
-     */
     private static final Logger log = LoggerFactory.getLogger(ValueFactoryImpl.class);
 
-    private final CoreValueFactory factory;
     private final NamePathMapper namePathMapper;
 
     /**
      * Creates a new instance of {@code ValueFactory}.
      *
-     * @param factory The core value factory.
      * @param namePathMapper The name/path mapping used for converting JCR names/paths to
      * the internal representation.
      */
-    public ValueFactoryImpl(CoreValueFactory factory, NamePathMapper namePathMapper) {
-        this.factory = factory;
+    public ValueFactoryImpl(NamePathMapper namePathMapper) {
         this.namePathMapper = namePathMapper;
     }
 
-    public CoreValueFactory getCoreValueFactory() {
-        return factory;
-    }
-
-    public Value createValue(CoreValue coreValue) {
-        return new ValueImpl(coreValue, namePathMapper);
-    }
-
     public static Value createValue(PropertyState property, NamePathMapper namePathMapper) {
-        return new ValueImpl(CoreValues.getValue(property), namePathMapper);
+        return new ValueImpl(property, namePathMapper);
     }
 
     public static List<Value> createValues(PropertyState property, NamePathMapper namePathMapper) {
-        List<CoreValue> cvs = CoreValues.getValues(property);
-        List<Value> vs = Lists.newArrayList();
-        for (CoreValue cv : cvs) {
-            vs.add(new ValueImpl(cv, namePathMapper));
+        List<PropertyValue> propertyValues = PropertyValues.create(property).values();
+        List<Value> values = Lists.newArrayList();
+        for (PropertyValue val : propertyValues) {
+            values.add(new ValueImpl(val, namePathMapper));
         }
-        return vs;
+        return values;
     }
 
-    public CoreValue getCoreValue(Value jcrValue) {
-        ValueImpl v;
-        if (jcrValue instanceof ValueImpl) {
-            v = (ValueImpl) jcrValue;
-        } else {
-            // TODO add proper implementation
+    //-------------------------------------------------------< ValueFactory >---
+
+    @Override
+    public Value createValue(String value) {
+        return new ValueImpl(PropertyValues.newString(value), namePathMapper);
+    }
+
+    @Override
+    public ValueImpl createValue(InputStream value) {
+        try {
             try {
-                switch (jcrValue.getType()) {
-                    case PropertyType.BINARY:
-                        v = (ValueImpl) createValue(jcrValue.getStream());
-                        break;
-                    default:
-                        v = (ValueImpl) createValue(jcrValue.getString(), jcrValue.getType());
-                }
-            } catch (RepositoryException e) {
-                throw new UnsupportedOperationException("Not implemented yet...");
+                // TODO add streaming capability to ContentSession via KernelBasedBlob
+                PropertyValue pv = PropertyValues.newBinary(ByteStreams.toByteArray(value));
+                return new ValueImpl(pv, namePathMapper);
+            } finally {
+                value.close();
             }
+        } catch (IOException ex) {
+            // TODO return a value which throws on each access instead
+            throw new RuntimeException(ex);
         }
-
-        return v.unwrap();
     }
 
-    //-------------------------------------------------------< ValueFactory >---
     @Override
-    public Value createValue(String value) {
-        CoreValue cv = factory.createValue(value, PropertyType.STRING);
-        return new ValueImpl(cv, namePathMapper);
+    public Value createValue(Binary value) {
+        try {
+            return createValue(value.getStream());
+        } catch (RepositoryException ex) {
+            // TODO return a value which throws on each access instead
+            throw new RuntimeException(ex);
+        }
     }
 
     @Override
     public Value createValue(long value) {
-        CoreValue cv = factory.createValue(value);
-        return new ValueImpl(cv, namePathMapper);
+        return new ValueImpl(PropertyValues.newLong(value), namePathMapper);
     }
 
     @Override
     public Value createValue(double value) {
-        CoreValue cv = factory.createValue(value);
-        return new ValueImpl(cv, namePathMapper);
-    }
-
-    @Override
-    public Value createValue(boolean value) {
-        CoreValue cv = factory.createValue(value);
-        return new ValueImpl(cv, namePathMapper);
+        return new ValueImpl(PropertyValues.newDouble(value), namePathMapper);
     }
 
     @Override
     public Value createValue(Calendar value) {
         String dateStr = ISO8601.format(value);
-        CoreValue cv = factory.createValue(dateStr, PropertyType.DATE);
-        return new ValueImpl(cv, namePathMapper);
+        return new ValueImpl(PropertyValues.newDate(dateStr), namePathMapper);
     }
 
     @Override
-    public Value createValue(InputStream value) {
-        try {
-            CoreValue cv = factory.createValue(value);
-            return new ValueImpl(cv, namePathMapper);
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        }
+    public Value createValue(boolean value) {
+        return new ValueImpl(PropertyValues.newBoolean(value), namePathMapper);
     }
 
     @Override
@@ -162,24 +134,50 @@ public class ValueFactoryImpl implements
     }
 
     @Override
-    public Value createValue(String value, int type) throws ValueFormatException {
+    public Value createValue(Node value, boolean weak) throws RepositoryException {
+        return weak
+            ? new ValueImpl(PropertyValues.newWeakReference(value.getUUID()), namePathMapper)
+            : new ValueImpl(PropertyValues.newReference(value.getUUID()), namePathMapper);
+    }
+
+    @Override
+    public Value createValue(BigDecimal value) {
+        return new ValueImpl(PropertyValues.newDecimal(value), namePathMapper);
+    }
 
+    @Override
+    public Value createValue(String value, int type) throws ValueFormatException {
         if (value == null) {
             throw new ValueFormatException();
         }
 
         try {
-            CoreValue cv;
-
+            PropertyValue pv;
             switch (type) {
+                case PropertyType.STRING:
+                    return createValue(value);
+                case PropertyType.BINARY:
+                    pv = PropertyValues.newBinary(value.getBytes("UTF-8"));
+                    break;
+                case PropertyType.LONG:
+                    return createValue(StringPropertyState.getLong(value));
+                case PropertyType.DOUBLE:
+                    return createValue(StringPropertyState.getDouble(value));
+                case PropertyType.DATE:
+                    if (ISO8601.parse(value) == null) {
+                        throw new ValueFormatException("Invalid date " + value);
+                    }
+                    pv = PropertyValues.newDate(value);
+                    break;
+                case PropertyType.BOOLEAN:
+                    return createValue(StringPropertyState.getBoolean(value));
                 case PropertyType.NAME:
                     String oakName = namePathMapper.getOakName(value);
                     if (oakName == null) {
                         throw new ValueFormatException("Invalid name: " + value);
                     }
-                    cv = factory.createValue(oakName, type);
+                    pv = PropertyValues.newName(oakName);
                     break;
-
                 case PropertyType.PATH:
                     String oakValue = value;
                     if (value.startsWith("[") && value.endsWith("]")) {
@@ -190,67 +188,44 @@ public class ValueFactoryImpl implements
                     if (oakValue == null) {
                         throw new ValueFormatException("Invalid path: " + value);
                     }
-                    cv = factory.createValue(oakValue, type);
+                    pv = PropertyValues.newPath(oakValue);
                     break;
-
-                case PropertyType.DATE:
-                    if (ISO8601.parse(value) == null) {
-                        throw new ValueFormatException("Invalid date " + value);
+                case PropertyType.REFERENCE:
+                    if (!IdentifierManager.isValidUUID(value)) {
+                        throw new ValueFormatException("Invalid reference value " + value);
                     }
-                    cv = factory.createValue(value, type);
+                    pv = PropertyValues.newReference(value);
                     break;
-
-                case PropertyType.REFERENCE:
                 case PropertyType.WEAKREFERENCE:
                     if (!IdentifierManager.isValidUUID(value)) {
-                        throw new ValueFormatException("Invalid reference value " + value);
+                        throw new ValueFormatException("Invalid weak reference value " + value);
                     }
-                    cv = factory.createValue(value, type);
+                    pv = PropertyValues.newWeakReference(value);
                     break;
-
-                case PropertyType.BINARY:
-                    cv = factory.createValue(new ByteArrayInputStream(value.getBytes("UTF-8")));
+                case PropertyType.URI:
+                    new URI(value);
+                    pv = PropertyValues.newUri(value);
                     break;
-
+                case PropertyType.DECIMAL:
+                    return createValue(StringPropertyState.getDecimal(value));
                 default:
-                    cv = factory.createValue(value, type);
-                    break;
+                    throw new ValueFormatException("Invalid type: " + type);
             }
 
-            return new ValueImpl(cv, namePathMapper);
+            return new ValueImpl(pv, namePathMapper);
         } catch (UnsupportedEncodingException e) {
             throw new ValueFormatException("Encoding UTF-8 not supported (this should not happen!)", e);
         } catch (IOException e) {
             throw new ValueFormatException(e);
         } catch (NumberFormatException e) {
-            throw new ValueFormatException("Invalid value " + value + " for type " + PropertyType.nameFromValue(type));
+            throw new ValueFormatException("Invalid value " + value + " for type " + PropertyType.nameFromValue(type), e);
+        } catch (URISyntaxException e) {
+            throw new ValueFormatException("Invalid value " + value + " for type " + PropertyType.nameFromValue(type), e);
         }
     }
 
     @Override
     public Binary createBinary(InputStream stream) throws RepositoryException {
-        ValueImpl value = (ValueImpl) createValue(stream);
-        return new BinaryImpl(value);
-    }
-
-    @Override
-    public Value createValue(Binary value) {
-        try {
-            return createValue(value.getStream());
-        } catch (RepositoryException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    @Override
-    public Value createValue(BigDecimal value) {
-        CoreValue cv = factory.createValue(value);
-        return new ValueImpl(cv, namePathMapper);
-    }
-
-    @Override
-    public Value createValue(Node value, boolean weak) throws RepositoryException {
-        CoreValue cv = factory.createValue(value.getUUID(), weak ? PropertyType.WEAKREFERENCE : PropertyType.REFERENCE);
-        return new ValueImpl(cv, namePathMapper);
+        return new BinaryImpl(createValue(stream));
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/value/ValueImpl.java Thu Oct 11 23:08:40 2012
@@ -32,7 +32,8 @@ import javax.jcr.ValueFormatException;
 import com.google.common.base.Charsets;
 import com.google.common.io.CharStreams;
 import com.google.common.io.InputSupplier;
-import org.apache.jackrabbit.oak.api.CoreValue;
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.util.ISO8601;
 import org.slf4j.Logger;
@@ -42,30 +43,20 @@ import org.slf4j.LoggerFactory;
  * ValueImpl...
  */
 public class ValueImpl implements Value {
-
-    /**
-     * logger instance
-     */
     private static final Logger log = LoggerFactory.getLogger(ValueImpl.class);
 
-    private final CoreValue value;
+    private final PropertyValue value;
     private final NamePathMapper namePathMapper;
 
     private InputStream stream = null;
 
-    /**
-     * Constructs a {@code ValueImpl} object based on a {@code CoreValue}
-     *
-     * @param value the value object this {@code ValueImpl} should represent
-     * @param namePathMapper
-     */
-    public ValueImpl(CoreValue value, NamePathMapper namePathMapper) {
+    ValueImpl(PropertyValue value, NamePathMapper namePathMapper) {
         this.value = value;
         this.namePathMapper = namePathMapper;
     }
 
-    CoreValue unwrap() {
-        return value;
+    public ValueImpl(PropertyState property, NamePathMapper namePathMapper) {
+        this(PropertyValues.create(property), namePathMapper);
     }
 
     //--------------------------------------------------------------< Value >---
@@ -74,7 +65,7 @@ public class ValueImpl implements Value 
      */
     @Override
     public int getType() {
-        return value.getType();
+        return value.getType().tag();
     }
 
     /**
@@ -83,7 +74,7 @@ public class ValueImpl implements Value 
     @Override
     public boolean getBoolean() throws RepositoryException {
         if (getType() == PropertyType.STRING || getType() == PropertyType.BINARY || getType() == PropertyType.BOOLEAN) {
-            return value.getBoolean();
+            return value.getValue(Type.BOOLEAN);
         } else {
             throw new ValueFormatException("Incompatible type " + PropertyType.nameFromValue(getType()));
         }
@@ -122,7 +113,7 @@ public class ValueImpl implements Value 
                     Calendar cal = getDate();
                     return BigDecimal.valueOf(cal.getTimeInMillis());
                 default:
-                    return value.getDecimal();
+                    return value.getValue(Type.DECIMAL);
             }
         } catch (NumberFormatException e) {
             throw new ValueFormatException("Incompatible type " + PropertyType.nameFromValue(getType()));
@@ -140,7 +131,7 @@ public class ValueImpl implements Value 
                     Calendar cal = getDate();
                     return cal.getTimeInMillis();
                 default:
-                    return value.getDouble();
+                    return value.getValue(Type.DOUBLE);
             }
         } catch (NumberFormatException e) {
             throw new ValueFormatException("Incompatible type " + PropertyType.nameFromValue(getType()));
@@ -158,7 +149,7 @@ public class ValueImpl implements Value 
                     Calendar cal = getDate();
                     return cal.getTimeInMillis();
                 default:
-                    return value.getLong();
+                    return value.getValue(Type.LONG);
             }
         } catch (NumberFormatException e) {
             throw new ValueFormatException("Incompatible type " + PropertyType.nameFromValue(getType()));
@@ -172,14 +163,14 @@ public class ValueImpl implements Value 
     public String getString() throws RepositoryException {
         switch (getType()) {
             case PropertyType.NAME:
-                return namePathMapper.getJcrName(value.toString());
+                return namePathMapper.getJcrName(value.getValue(Type.STRING));
             case PropertyType.PATH:
-                String s = value.toString();
+                String s = value.getValue(Type.STRING);
                 if (s.startsWith("[") && s.endsWith("]")) {
                     // identifier paths are returned as-is (JCR 2.0, 3.4.3.1)
                     return s;
                 } else {
-                    return namePathMapper.getJcrPath(value.toString());
+                    return namePathMapper.getJcrPath(s);
                 }
             case PropertyType.BINARY:
                 if (stream != null) {
@@ -187,18 +178,23 @@ public class ValueImpl implements Value 
                             "In this case a new Value instance must be acquired in order to successfully call this method.");
                 }
                 try {
-                    return CharStreams.toString(CharStreams.newReaderSupplier(
-                            new InputSupplier<InputStream>() {
-                                @Override
-                                public InputStream getInput() {
-                                    return value.getNewStream();
-                                }
-                            }, Charsets.UTF_8));
+                    final InputStream is = value.getValue(Type.BINARY).getNewStream();
+                    try {
+                        return CharStreams.toString(CharStreams.newReaderSupplier(
+                                new InputSupplier<InputStream>() {
+                                    @Override
+                                    public InputStream getInput() {
+                                        return is;
+                                    }
+                                }, Charsets.UTF_8));
+                    } finally {
+                        is.close();
+                    }
                 } catch (IOException e) {
                     throw new RepositoryException("conversion from stream to string failed", e);
                 }
             default:
-                return value.toString();
+                return value.getValue(Type.STRING);
         }
     }
 
@@ -213,14 +209,18 @@ public class ValueImpl implements Value 
         return stream;
     }
 
-    private InputStream getNewStream() throws RepositoryException {
+    InputStream getNewStream() throws RepositoryException {
         switch (getType()) {
-        case PropertyType.NAME:
-        case PropertyType.PATH:
-            return new ByteArrayInputStream(
-                    getString().getBytes(Charsets.UTF_8));
+            case PropertyType.NAME:
+            case PropertyType.PATH:
+                return new ByteArrayInputStream(
+                        getString().getBytes(Charsets.UTF_8));
         }
-        return value.getNewStream();
+        return value.getValue(Type.BINARY).getNewStream();
+    }
+
+    long getStreamLength() {
+        return value.getValue(Type.BINARY).length();
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java Thu Oct 11 23:08:40 2012
@@ -35,7 +35,7 @@ import org.apache.jackrabbit.oak.securit
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Filter;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.apache.jackrabbit.oak.spi.query.QueryIndex;
 import org.junit.Test;
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/AbstractQueryTest.java Thu Oct 11 23:08:40 2012
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.oak.query;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -47,12 +43,16 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.plugins.index.IndexConstants;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 /**
  * AbstractQueryTest...
  */

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java Thu Oct 11 23:08:40 2012
@@ -27,8 +27,8 @@ import java.util.Random;
 
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.spi.query.Filter;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 import org.junit.Test;
 
 /**

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java Thu Oct 11 23:08:40 2012
@@ -96,7 +96,7 @@ public class SessionDelegate {
         this.session = new SessionImpl(this);
         this.idManager = new IdentifierManager(root);
         this.namePathMapper = new NamePathMapperImpl(new SessionNameMapper(this), idManager);
-        this.valueFactory = new ValueFactoryImpl(contentSession.getCoreValueFactory(), namePathMapper);
+        this.valueFactory = new ValueFactoryImpl(namePathMapper);
     }
 
     /**

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryManagerImpl.java Thu Oct 11 23:08:40 2012
@@ -42,8 +42,8 @@ import org.apache.jackrabbit.oak.jcr.Ses
 import org.apache.jackrabbit.oak.jcr.query.qom.QueryObjectModelFactoryImpl;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.plugins.memory.PropertyStates;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
-import org.apache.jackrabbit.oak.spi.query.PropertyValues;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValues;
 
 /**
  * The implementation of the corresponding JCR interface.

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java Thu Oct 11 23:08:40 2012
@@ -36,8 +36,8 @@ import org.apache.jackrabbit.oak.commons
 import org.apache.jackrabbit.oak.jcr.NodeDelegate;
 import org.apache.jackrabbit.oak.jcr.NodeImpl;
 import org.apache.jackrabbit.oak.jcr.SessionDelegate;
-import org.apache.jackrabbit.oak.plugins.memory.CoreValues;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
+import org.apache.jackrabbit.oak.value.ValueFactoryImpl;
 
 /**
  * The implementation of the corresponding JCR interface.
@@ -229,7 +229,9 @@ public class QueryResultImpl implements 
     }
 
     Value createValue(PropertyValue value) {
-        return value == null ? null : sessionDelegate.getValueFactory().createValue(CoreValues.getValue(value.unwrap()));
+        return value == null
+            ? null
+            : ValueFactoryImpl.createValue(value.unwrap(), sessionDelegate.getNamePathMapper());
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java?rev=1397360&r1=1397359&r2=1397360&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/RowImpl.java Thu Oct 11 23:08:40 2012
@@ -24,7 +24,7 @@ import javax.jcr.Value;
 import javax.jcr.query.Row;
 
 import org.apache.jackrabbit.oak.api.ResultRow;
-import org.apache.jackrabbit.oak.spi.query.PropertyValue;
+import org.apache.jackrabbit.oak.value.PropertyValue;
 
 /**
  * The implementation of the corresponding JCR interface.



Mime
View raw message