jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770612 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Date Fri, 01 May 2009 10:20:59 GMT
Author: jukka
Date: Fri May  1 10:20:59 2009
New Revision: 770612

URL: http://svn.apache.org/viewvc?rev=770612&view=rev
Log:
JCR-2056: JSR 283: Binary interfaces

Added missing Property methods in jcr2spi

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=770612&r1=770611&r2=770612&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Fri May  1 10:20:59 2009
@@ -16,36 +16,36 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
-import org.apache.jackrabbit.jcr2spi.operation.Operation;
-import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.spi.QValue;
-import org.apache.jackrabbit.spi.QPropertyDefinition;
-import org.apache.jackrabbit.spi.commons.value.ValueFormat;
-import org.apache.jackrabbit.value.ValueHelper;
-import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.Calendar;
 
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.lock.LockException;
-import javax.jcr.version.VersionException;
 import javax.jcr.Binary;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.Property;
 import javax.jcr.Item;
-import javax.jcr.RepositoryException;
-import javax.jcr.Node;
 import javax.jcr.ItemVisitor;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
-import javax.jcr.PropertyType;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.Calendar;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.jcr2spi.operation.Operation;
+import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
+import org.apache.jackrabbit.jcr2spi.state.PropertyState;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.QPropertyDefinition;
+import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.apache.jackrabbit.spi.commons.value.ValueFormat;
+import org.apache.jackrabbit.value.ValueHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <code>PropertyImpl</code>...
@@ -196,6 +196,19 @@
     }
 
     /**
+     * @see Property#setValue(Binary)
+     */
+    public void setValue(Binary value) throws RepositoryException {
+        checkIsWritable(false);
+        int reqType = getRequiredType(PropertyType.BINARY);
+        if (value == null) {
+            setInternalValues(null, reqType);
+        } else {
+            setValue(session.getValueFactory().createValue(value), reqType);
+        }
+    }
+
+    /**
      * @see Property#setValue(long)
      */
     public void setValue(long value) throws ValueFormatException, VersionException, LockException,
RepositoryException {
@@ -294,6 +307,13 @@
     }
 
     /**
+     * @see Property#getBinary()
+     */
+    public Binary getBinary() throws RepositoryException {
+        return getValue().getBinary();
+    }
+
+    /**
      * @see Property#getLong()
      */
     public long getLong() throws ValueFormatException, RepositoryException {



Mime
View raw message