jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r777936 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/
Date Sat, 23 May 2009 14:49:51 GMT
Author: stefan
Date: Sat May 23 14:49:50 2009
New Revision: 777936

URL: http://svn.apache.org/viewvc?rev=777936&view=rev
Log:
JCR-1609:  new Property Types (WIP...)



Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DoubleValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/LongValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/NameValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/PathValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ReferenceValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BooleanValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BooleanValue.java
Sat May 23 14:49:50 2009
@@ -20,6 +20,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>BooleanValue</code> provides an implementation
@@ -160,4 +161,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DateValue.java
Sat May 23 14:49:50 2009
@@ -22,6 +22,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>DateValue</code> provides an implementation
@@ -191,4 +192,19 @@
             throw new ValueFormatException("empty value");
         }
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        if (date != null) {
+            return new BigDecimal(date.getTimeInMillis());
+        } else {
+            throw new ValueFormatException("empty value");
+        }
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DoubleValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DoubleValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DoubleValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DoubleValue.java
Sat May 23 14:49:50 2009
@@ -21,6 +21,7 @@
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
 import java.util.Date;
+import java.math.BigDecimal;
 
 /**
  * A <code>DoubleValue</code> provides an implementation
@@ -178,4 +179,19 @@
             throw new ValueFormatException("empty value");
         }
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        if (dblNumber != null) {
+            return new BigDecimal(dblNumber.doubleValue());
+        } else {
+            throw new ValueFormatException("empty value");
+        }
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/LongValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/LongValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/LongValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/LongValue.java
Sat May 23 14:49:50 2009
@@ -21,6 +21,7 @@
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
 import java.util.Date;
+import java.math.BigDecimal;
 
 /**
  * A <code>LongValue</code> provides an implementation
@@ -178,4 +179,19 @@
             throw new ValueFormatException("empty value");
         }
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        if (lNumber != null) {
+            return new BigDecimal(lNumber.longValue());
+        } else {
+            throw new ValueFormatException("empty value");
+        }
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/NameValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/NameValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/NameValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/NameValue.java
Sat May 23 14:49:50 2009
@@ -26,6 +26,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>NameValue</code> provides an implementation
@@ -212,4 +213,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/PathValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/PathValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/PathValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/PathValue.java
Sat May 23 14:49:50 2009
@@ -23,6 +23,7 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>PathValue</code> provides an implementation
@@ -166,4 +167,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ReferenceValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ReferenceValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ReferenceValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ReferenceValue.java
Sat May 23 14:49:50 2009
@@ -24,6 +24,7 @@
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>ReferenceValue</code> provides an implementation
@@ -184,4 +185,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
Sat May 23 14:49:50 2009
@@ -22,6 +22,7 @@
 import java.util.Calendar;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.math.BigDecimal;
 
 /**
  * A <code>URIValue</code> provides an implementation
@@ -162,4 +163,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java?rev=777936&r1=777935&r2=777936&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java
Sat May 23 14:49:50 2009
@@ -24,6 +24,7 @@
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ValueFormatException;
 import java.util.Calendar;
+import java.math.BigDecimal;
 
 /**
  * A <code>WeakReferenceValue</code> provides an implementation
@@ -184,4 +185,15 @@
 
         throw new ValueFormatException("conversion to double failed: inconvertible types");
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    public BigDecimal getDecimal()
+            throws ValueFormatException, IllegalStateException,
+            RepositoryException {
+        setValueConsumed();
+
+        throw new ValueFormatException("conversion to Decimal failed: inconvertible types");
+    }
 }
\ No newline at end of file



Mime
View raw message