jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r468339 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: PropertyImpl.java SessionImpl.java
Date Fri, 27 Oct 2006 10:19:50 GMT
Author: angela
Date: Fri Oct 27 03:19:49 2006
New Revision: 468339

URL: http://svn.apache.org/viewvc?view=rev&rev=468339
Log:
work in progress

- add internal method in order to access valuefactory omitting the check for level 2 compliance.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?view=diff&rev=468339&r1=468338&r2=468339
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Fri Oct 27 03:19:49 2006
@@ -273,7 +273,7 @@
      */
     public Value getValue() throws ValueFormatException, RepositoryException {
         QValue value = getQValue();
-        return ValueFormat.getJCRValue(value, session.getNamespaceResolver(), session.getValueFactory());
+        return ValueFormat.getJCRValue(value, session.getNamespaceResolver(), session.internalGetValueFactory());
     }
 
     /**
@@ -283,7 +283,7 @@
         QValue[] qValues = getQValues();
         Value[] values = new Value[qValues.length];
         for (int i = 0; i < qValues.length; i++) {
-            values[i] = ValueFormat.getJCRValue(qValues[i], session.getNamespaceResolver(),
session.getValueFactory());
+            values[i] = ValueFormat.getJCRValue(qValues[i], session.getNamespaceResolver(),
session.internalGetValueFactory());
         }
         return values;
     }
@@ -377,7 +377,7 @@
                 length = value.getLength();
                 break;
             case PropertyType.NAME:
-                Value jcrValue = ValueFormat.getJCRValue(value, session.getNamespaceResolver(),
session.getValueFactory());
+                Value jcrValue = ValueFormat.getJCRValue(value, session.getNamespaceResolver(),
session.internalGetValueFactory());
                 length = jcrValue.getString().length();
                 break;
         }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?view=diff&rev=468339&r1=468338&r2=468339
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Fri Oct 27 03:19:49 2006
@@ -140,7 +140,7 @@
         nsMappings = new LocalNamespaceMappings(workspace.getNamespaceRegistryImpl());
 
         // build nodetype manager
-        ntManager = new NodeTypeManagerImpl(workspace.getNodeTypeRegistry(), getNamespaceResolver(),
getValueFactory());
+        ntManager = new NodeTypeManagerImpl(workspace.getNodeTypeRegistry(), getNamespaceResolver(),
internalGetValueFactory());
 
         validator = new ItemStateValidator(workspace.getNodeTypeRegistry(), this);
 
@@ -364,6 +364,19 @@
         // must throw UnsupportedRepositoryOperationException if writing is
         // not supported
         checkSupportedOption(Repository.LEVEL_2_SUPPORTED);
+        return internalGetValueFactory();
+    }
+
+    /**
+     * Same as {@link #getValueFactory()} but omits the check, if this repository
+     * is really level 2 compliant. Therefore, this method may be used for
+     * internal functionality only, that require creation and conversion of
+     * JCR values.
+     *
+     * @return
+     * @throws RepositoryException
+     */
+    ValueFactory internalGetValueFactory() throws RepositoryException {
         return config.getValueFactory();
     }
 



Mime
View raw message