jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r209092 - in /incubator/jackrabbit/trunk: commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java core/src/java/org/apache/jackrabbit/core/SessionImpl.java core/src/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
Date Mon, 04 Jul 2005 15:24:28 GMT
Author: stefan
Date: Mon Jul  4 08:24:25 2005
New Revision: 209092

URL: http://svn.apache.org/viewcvs?rev=209092&view=rev
Log:
JCR-157: Reorganize Jackrabbit into 'core' 'api' and 'commons'

Added:
    incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
  (with props)
Removed:
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/value/ValueFactoryImpl.java
Modified:
    incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java

Added: incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java?rev=209092&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
(added)
+++ incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
Mon Jul  4 08:24:25 2005
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.value;
+
+import org.apache.jackrabbit.value.BinaryValue;
+import org.apache.jackrabbit.value.BooleanValue;
+import org.apache.jackrabbit.value.DateValue;
+import org.apache.jackrabbit.value.DoubleValue;
+import org.apache.jackrabbit.value.LongValue;
+import org.apache.jackrabbit.value.ReferenceValue;
+import org.apache.jackrabbit.value.StringValue;
+import org.apache.jackrabbit.value.ValueHelper;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.ValueFormatException;
+import java.io.InputStream;
+import java.util.Calendar;
+
+/**
+ * This class implements the  <code>ValueFactory</code> interface.
+ *
+ * @see javax.jcr.Session#getValueFactory()
+ */
+public class ValueFactoryImpl implements ValueFactory {
+
+    /**
+     * Constructs a <code>ValueFactory</code> object.
+     */
+    public ValueFactoryImpl() {
+    }
+
+    //---------------------------------------------------------< ValueFactory >
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(boolean value) {
+        return new BooleanValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(Calendar value) {
+        return new DateValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(double value) {
+        return new DoubleValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(InputStream value) {
+        return new BinaryValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(long value) {
+        return new LongValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(Node value) throws RepositoryException {
+        return new ReferenceValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(String value) {
+        return new StringValue(value);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value createValue(String value, int type)
+            throws ValueFormatException {
+        return ValueHelper.convert(value, type);
+    }
+}

Propchange: incubator/jackrabbit/trunk/commons/src/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=209092&r1=209091&r2=209092&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/SessionImpl.java Mon
Jul  4 08:24:25 2005
@@ -30,7 +30,7 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.SessionItemStateManager;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
-import org.apache.jackrabbit.core.value.ValueFactoryImpl;
+import org.apache.jackrabbit.value.ValueFactoryImpl;
 import org.apache.jackrabbit.core.version.VersionManager;
 import org.apache.jackrabbit.core.xml.DocViewSAXEventGenerator;
 import org.apache.jackrabbit.core.xml.ImportHandler;



Mime
View raw message