You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by an...@apache.org on 2012/04/23 17:42:20 UTC

svn commit: r1329293 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api: CoreValue.java CoreValueFactory.java

Author: angela
Date: Mon Apr 23 15:42:20 2012
New Revision: 1329293

URL: http://svn.apache.org/viewvc?rev=1329293&view=rev
Log:
OAK-16 : Proper ValueFactory implementation and Value handling (WIP)

NOTE: this is a proposal drafting how we could combine a reasonable
implementation of the JCR value handling with the needs we have on oak-api... 

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java?rev=1329293&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java Mon Apr 23 15:42:20 2012
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.api;
+
+import java.io.InputStream;
+import java.math.BigDecimal;
+
+/**
+ * CoreValue... TODO: add description and javadoc for methods
+ */
+public interface CoreValue {
+
+    int getType();
+
+    String getString();
+
+    long getLong();
+
+    double getDouble();
+
+    boolean getBoolean();
+
+    BigDecimal getDecimal();
+
+    /**
+     * Returns a new stream for this value object.
+     *
+     * @return a new stream.
+     */
+    InputStream getNewStream();
+
+    long length();
+}
\ No newline at end of file

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java?rev=1329293&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java (added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java Mon Apr 23 15:42:20 2012
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.api;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+
+/**
+ * CoreValueFactory... TODO: add description and javadoc for methods
+ */
+public interface CoreValueFactory {
+
+    CoreValue createValue(String value);
+
+    CoreValue createValue(double value);
+
+    CoreValue createValue(long value);
+
+    CoreValue createValue(boolean value);
+
+    CoreValue createValue(BigDecimal value);
+
+    CoreValue createValue(InputStream value) throws IOException;
+
+    CoreValue createValue(String value, int type);
+}
\ No newline at end of file