jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r421198 - in /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit: core/ core/nodetype/ core/nodetype/compact/ core/nodetype/xml/ core/xml/ value/
Date Wed, 12 Jul 2006 09:16:52 GMT
Author: tripod
Date: Wed Jul 12 02:16:52 2006
New Revision: 421198

URL: http://svn.apache.org/viewvc?rev=421198&view=rev
Log:
JCR-473 Some enhancements to jackrabbit commons (fixed some deprecated calls)

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/StringValue.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/value/BooleanValue.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
Wed Jul 12 02:16:52 2006
@@ -30,6 +30,7 @@
 import org.apache.jackrabbit.value.DoubleValue;
 import org.apache.jackrabbit.value.LongValue;
 import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -350,7 +351,8 @@
             // type conversion required
             Value targetValue = ValueHelper.convert(
                     InternalValue.create(name).toJCRValue(session.getNamespaceResolver()),
-                    reqType);
+                    reqType,
+                    ValueFactoryImpl.getInstance());
             internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -400,7 +402,8 @@
                         // type conversion required
                         Value targetValue = ValueHelper.convert(
                                 InternalValue.create(name).toJCRValue(session.getNamespaceResolver()),
-                                reqType);
+                                reqType,
+                                ValueFactoryImpl.getInstance());
                         internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
                     } else {
                         // no type conversion required
@@ -689,7 +692,9 @@
         InternalValue value;
         if (reqType != PropertyType.DATE) {
             // type conversion required
-            Value targetVal = ValueHelper.convert(new DateValue(date), reqType);
+            Value targetVal = ValueHelper.convert(
+                    new DateValue(date), reqType,
+                    ValueFactoryImpl.getInstance());
             value = InternalValue.create(targetVal, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -721,7 +726,9 @@
         InternalValue value;
         if (reqType != PropertyType.DOUBLE) {
             // type conversion required
-            Value targetVal = ValueHelper.convert(new DoubleValue(number), reqType);
+            Value targetVal = ValueHelper.convert(
+                    new DoubleValue(number), reqType,
+                    ValueFactoryImpl.getInstance());
             value = InternalValue.create(targetVal, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -759,7 +766,9 @@
         try {
             if (reqType != PropertyType.BINARY) {
                 // type conversion required
-                Value targetVal = ValueHelper.convert(new BLOBFileValue(stream), reqType);
+                Value targetVal = ValueHelper.convert(
+                        new BLOBFileValue(stream), reqType,
+                        ValueFactoryImpl.getInstance());
                 value = InternalValue.create(targetVal, session.getNamespaceResolver());
             } else {
                 // no type conversion required
@@ -801,7 +810,9 @@
         InternalValue internalValue;
         if (reqType != PropertyType.STRING) {
             // type conversion required
-            Value targetValue = ValueHelper.convert(string, reqType);
+            Value targetValue = ValueHelper.convert(
+                    string, reqType,
+                    ValueFactoryImpl.getInstance());
             internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -839,7 +850,9 @@
                 if (string != null) {
                     if (reqType != PropertyType.STRING) {
                         // type conversion required
-                        Value targetValue = ValueHelper.convert(string, reqType);
+                        Value targetValue = ValueHelper.convert(
+                                string, reqType,
+                                ValueFactoryImpl.getInstance());
                         internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
                     } else {
                         // no type conversion required
@@ -875,7 +888,9 @@
         InternalValue value;
         if (reqType != PropertyType.BOOLEAN) {
             // type conversion required
-            Value targetVal = ValueHelper.convert(new BooleanValue(b), reqType);
+            Value targetVal = ValueHelper.convert(
+                    new BooleanValue(b), reqType,
+                    ValueFactoryImpl.getInstance());
             value = InternalValue.create(targetVal, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -949,7 +964,9 @@
         InternalValue value;
         if (reqType != PropertyType.LONG) {
             // type conversion required
-            Value targetVal = ValueHelper.convert(new LongValue(number), reqType);
+            Value targetVal = ValueHelper.convert(
+                    new LongValue(number), reqType,
+                    ValueFactoryImpl.getInstance());
             value = InternalValue.create(targetVal, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -990,7 +1007,9 @@
         InternalValue internalValue;
         if (reqType != value.getType()) {
             // type conversion required
-            Value targetVal = ValueHelper.convert(value, reqType);
+            Value targetVal = ValueHelper.convert(
+                    value, reqType,
+                    ValueFactoryImpl.getInstance());
             internalValue = InternalValue.create(targetVal, session.getNamespaceResolver());
         } else {
             // no type conversion required
@@ -1048,7 +1067,9 @@
                     }
                     if (reqType != value.getType()) {
                         // type conversion required
-                        Value targetVal = ValueHelper.convert(value, reqType);
+                        Value targetVal = ValueHelper.convert(
+                                value, reqType,
+                                ValueFactoryImpl.getInstance());
                         internalValue = InternalValue.create(targetVal, session.getNamespaceResolver());
                     } else {
                         // no type conversion required

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
Wed Jul 12 02:16:52 2006
@@ -24,6 +24,7 @@
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -381,7 +382,9 @@
             InternalValue internalValue;
             if (targetType != value.getType()) {
                 // type conversion required
-                Value targetVal = ValueHelper.convert(value, targetType);
+                Value targetVal = ValueHelper.convert(
+                        value, targetType,
+                        ValueFactoryImpl.getInstance());
                 internalValue = InternalValue.create(targetVal, nsResolver);
             } else {
                 // no type conversion required
@@ -457,7 +460,9 @@
                     InternalValue internalValue;
                     if (targetType != type) {
                         // type conversion required
-                        Value targetVal = ValueHelper.convert(values[i], targetType);
+                        Value targetVal = ValueHelper.convert(
+                                values[i], targetType,
+                                ValueFactoryImpl.getInstance());
                         internalValue = InternalValue.create(targetVal, nsResolver);
                     } else {
                         // no type conversion required

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
Wed Jul 12 02:16:52 2006
@@ -31,6 +31,7 @@
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.util.name.NamespaceMapping;
 import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 
 import javax.jcr.NamespaceException;
 import javax.jcr.PropertyType;
@@ -485,7 +486,9 @@
             nextToken();
             InternalValue value = null;
             try {
-                value = InternalValue.create(ValueHelper.convert(currentToken, pdi.getRequiredType()),
nsMapping);
+                value = InternalValue.create(ValueHelper.convert(
+                        currentToken, pdi.getRequiredType(),
+                        ValueFactoryImpl.getInstance()), nsMapping);
             } catch (ValueFormatException e) {
                 lexer.fail("'" + currentToken + "' is not a valid string representation of
a value of type " + pdi.getRequiredType());
             } catch (RepositoryException e) {

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/xml/NodeTypeReader.java
Wed Jul 12 02:16:52 2006
@@ -32,6 +32,7 @@
 import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.UnknownPrefixException;
 import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -256,7 +257,8 @@
             while (walker.iterateElements(Constants.DEFAULTVALUE_ELEMENT)) {
                 String value = walker.getContent();
                 try {
-                    values.add(InternalValue.create(ValueHelper.convert(value, type), resolver));
+                    values.add(InternalValue.create(ValueHelper.convert(
+                            value, type, ValueFactoryImpl.getInstance()), resolver));
                 } catch (RepositoryException e) {
                     throw new InvalidNodeTypeDefException(
                             "Unable to create default value: " + value, e);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/BufferedStringValue.java
Wed Jul 12 02:16:52 2006
@@ -16,6 +16,19 @@
  */
 package org.apache.jackrabbit.core.xml;
 
+import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.util.Base64;
+import org.apache.jackrabbit.util.TransientFileFactory;
+import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -26,19 +39,6 @@
 import java.io.StringReader;
 import java.io.Writer;
 
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.ValueFormatException;
-
-import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.util.Base64;
-import org.apache.jackrabbit.util.TransientFileFactory;
-import org.apache.jackrabbit.value.ValueHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * <code>BufferedStringValue</code> represents an appendable
  * serialized value that is either buffered in-memory or backed
@@ -238,7 +238,8 @@
                 // convert serialized value to InternalValue using
                 // current namespace context of xml document
                 InternalValue ival =
-                    InternalValue.create(ValueHelper.convert(retrieve(), targetType), nsContext);
+                    InternalValue.create(ValueHelper.convert(
+                            retrieve(), targetType, ValueFactoryImpl.getInstance()), nsContext);
                 // convert InternalValue to Value using this
                 // session's namespace mappings
                 return ival.toJCRValue(resolver);
@@ -297,7 +298,8 @@
             } else {
                 // convert serialized value to InternalValue using
                 // current namespace context of xml document
-                return InternalValue.create(ValueHelper.convert(retrieve(), type), nsContext);
+                return InternalValue.create(ValueHelper.convert(
+                        retrieve(), type, ValueFactoryImpl.getInstance()), nsContext);
             }
         } catch (IOException e) {
             throw new RepositoryException("Error accessing property value", e);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/StringValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/StringValue.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/StringValue.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/StringValue.java
Wed Jul 12 02:16:52 2006
@@ -16,18 +16,18 @@
  */
 package org.apache.jackrabbit.core.xml;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
+import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.util.Base64;
+import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
-
-import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.util.Base64;
-import org.apache.jackrabbit.value.ValueHelper;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 
 /**
  * <code>StringValue</code> represents an immutable serialized value.
@@ -61,15 +61,16 @@
             // convert serialized value to InternalValue using
             // current namespace context of xml document
             InternalValue ival =
-                    InternalValue.create(ValueHelper.convert(value, type), nsContext);
+                    InternalValue.create(ValueHelper.convert(
+                            value, type, ValueFactoryImpl.getInstance()), nsContext);
             // convert InternalValue to Value using this
             // session's namespace mappings
             return ival.toJCRValue(resolver);
         } else if (type == PropertyType.BINARY) {
-            return ValueHelper.deserialize(value, type, false);
+            return ValueHelper.deserialize(value, type, false, ValueFactoryImpl.getInstance());
         } else {
             // all other types
-            return ValueHelper.deserialize(value, type, true);
+            return ValueHelper.deserialize(value, type, true, ValueFactoryImpl.getInstance());
         }
     }
 
@@ -85,7 +86,8 @@
             } else {
                 // convert serialized value to InternalValue using
                 // current namespace context of xml document
-                return InternalValue.create(ValueHelper.convert(value, targetType), nsContext);
+                return InternalValue.create(ValueHelper.convert(
+                        value, targetType, ValueFactoryImpl.getInstance()), nsContext);
             }
         } catch (IOException e) {
             throw new RepositoryException("Error decoding Base64 content", e);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/value/BooleanValue.java?rev=421198&r1=421197&r2=421198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
Wed Jul 12 02:16:52 2006
@@ -48,7 +48,7 @@
      */
     public BooleanValue(boolean bool) {
         super(TYPE);
-        this.bool = new Boolean(bool);
+        this.bool = Boolean.valueOf(bool);
     }
 
     /**



Mime
View raw message