You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2009/05/01 12:15:47 UTC
svn commit: r770610 -
/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Author: jukka
Date: Fri May 1 10:15:47 2009
New Revision: 770610
URL: http://svn.apache.org/viewvc?rev=770610&view=rev
Log:
JCR-1609: JSR 283: new Property Types
Simple implementations of missing Property methods
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=770610&r1=770609&r2=770610&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:15:47 2009
@@ -33,6 +33,8 @@
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;
@@ -42,6 +44,7 @@
import javax.jcr.ValueFormatException;
import javax.jcr.PropertyType;
import java.io.InputStream;
+import java.math.BigDecimal;
import java.util.Calendar;
/**
@@ -211,6 +214,15 @@
}
/**
+ * @see Property#setValue(BigDecimal)
+ */
+ public void setValue(BigDecimal value) throws RepositoryException {
+ checkIsWritable(false);
+ int reqType = getRequiredType(PropertyType.DECIMAL);
+ setValue(session.getValueFactory().createValue(value), reqType);
+ }
+
+ /**
* @see Property#setValue(Calendar)
*/
public void setValue(Calendar value) throws ValueFormatException, VersionException, LockException, RepositoryException {
@@ -296,6 +308,13 @@
}
/**
+ * @see Property#getDecimal()
+ */
+ public BigDecimal getDecimal() throws RepositoryException {
+ return getValue().getDecimal();
+ }
+
+ /**
* @see Property#getDate()
*/
public Calendar getDate() throws ValueFormatException, RepositoryException {
@@ -322,6 +341,14 @@
}
/**
+ * @see Property#getProperty()
+ */
+ public Property getProperty() throws RepositoryException {
+ // TODO JCR-1609 - this should probably be handled a bit better...
+ return getParent().getProperty(getString());
+ }
+
+ /**
* @see Property#getLength
*/
public long getLength() throws ValueFormatException, RepositoryException {
@@ -536,4 +563,5 @@
throw new ValueFormatException("Property must be of type REFERENCE.");
}
}
+
}