jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1336065 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api: ContentSession.java CoreValue.java CoreValueFactory.java
Date Wed, 09 May 2012 10:41:08 GMT
Author: angela
Date: Wed May  9 10:41:07 2012
New Revision: 1336065

URL: http://svn.apache.org/viewvc?rev=1336065&view=rev
Log:
javadoc

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
    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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java?rev=1336065&r1=1336064&r2=1336065&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentSession.java
Wed May  9 10:41:07 2012
@@ -77,6 +77,11 @@ public interface ContentSession extends 
      */
     QueryEngine getQueryEngine();
 
+    /**
+     * Returns the internal value factory.
+     *
+     * @return the internal value factory.
+     */
     CoreValueFactory getCoreValueFactory();
 
     // TODO : add versioning operations

Modified: 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=1336065&r1=1336064&r2=1336065&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValue.java
Wed May  9 10:41:07 2012
@@ -20,28 +20,96 @@ import java.io.InputStream;
 import java.math.BigDecimal;
 
 /**
- * CoreValue... TODO: add description and javadoc for methods
+ * {@code CoreValue} is the internal representation of a {@link javax.jcr.Value
+ * JCR value}. It is therefore isolated from session-specific namespace mappings
+ * and relies on the internal representation of JCR names and paths.
  */
 public interface CoreValue extends Comparable<CoreValue> {
 
+    /**
+     * Returns the type of this value object which any of the following property
+     * types defined by the JCR specification:
+     *
+     * <ul>
+     *     <li>{@link javax.jcr.PropertyType#BINARY BINARY}</li>
+     *     <li>{@link javax.jcr.PropertyType#BOOLEAN BOOLEAN}</li>
+     *     <li>{@link javax.jcr.PropertyType#DATE DATE}</li>
+     *     <li>{@link javax.jcr.PropertyType#DECIMAL DECIMAL}</li>
+     *     <li>{@link javax.jcr.PropertyType#DOUBLE DOUBLE}</li>
+     *     <li>{@link javax.jcr.PropertyType#LONG LONG}</li>
+     *     <li>{@link javax.jcr.PropertyType#NAME NAME}</li>
+     *     <li>{@link javax.jcr.PropertyType#PATH PATH}</li>
+     *     <li>{@link javax.jcr.PropertyType#REFERENCE REFERENCE}</li>
+     *     <li>{@link javax.jcr.PropertyType#STRING STRING}</li>
+     *     <li>{@link javax.jcr.PropertyType#URI URI}</li>
+     *     <li>{@link javax.jcr.PropertyType#WEAKREFERENCE WEAKREFERENCE}</li>
+     * </ul>
+     *
+     * @return The type of this value instance. The return value is any of
+     * the types defined by {@link javax.jcr.PropertyType} except for
+     * {@link javax.jcr.PropertyType#UNDEFINED UNDEFINED}.
+     */
     int getType();
 
+    /**
+     * Returns a {@code String} representation of this value. Note that the
+     * string reflects the internal state and doesn't respect any session level
+     * namespace remapping.
+     *
+     * @return The string representation of this value.
+     */
     String getString();
 
+    /**
+     * Returns a {@code long} representation of this value.
+     *
+     * @return A {@code long} representation of this value based on an internal
+     * conversion.
+     * @throws NumberFormatException If the conversion fails.
+     */
     long getLong();
 
+    /**
+     * Returns a {@code double} representation of this value.
+     *
+     * @return A {@code double} representation of this value based on an internal
+     * conversion.
+     * @throws NumberFormatException If the conversion fails.
+     */
     double getDouble();
 
+    /**
+     * Returns a {@code boolean} representation of this value.
+     *
+     * @return A {@code boolean} representation of this value based on an internal
+     * conversion.
+     * @throws {@code UnsupportedOperationException} If the value cannot be
+     * converted a {@code boolean}.
+     */
     boolean getBoolean();
 
+    /**
+     * Returns a {@code BigDecimal} representation of this value.
+     *
+     * @return A {@code BigDecimal} representation of this value based on an
+     * internal conversion.
+     * @throws {@code NumberFormatException} If the value cannot be converted
+     * a {@code BigDecimal}.
+     */
     BigDecimal getDecimal();
 
     /**
      * Returns a new stream for this value object.
      *
-     * @return a new stream.
+     * @return a new stream for this value based on an internal conversion.
+     * @throws //TODO define exceptions
      */
     InputStream getNewStream();
 
+    /**
+     * Returns the length of this value.
+     *
+     * @return the length of this value.
+     */
     long length();
 }
\ No newline at end of file

Modified: 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=1336065&r1=1336064&r2=1336065&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/CoreValueFactory.java
Wed May  9 10:41:07 2012
@@ -21,21 +21,76 @@ import java.io.InputStream;
 import java.math.BigDecimal;
 
 /**
- * CoreValueFactory... TODO: add description and javadoc for methods
+ * {@code CoreValueFactory} defines methods to create new instances of
+ * {@code CoreValue}.
  */
 public interface CoreValueFactory {
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#STRING}.
+     *
+     * @param value A non-null {@code String} defining the new value.
+     * @return a new value instance.
+     * @throws IllegalArgumentException if the specified {@code String}
+     * is {@code null}.
+     */
     CoreValue createValue(String value);
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#DOUBLE}.
+     *
+     * @param value The {@code double} that defines the new value.
+     * @return a new value instance.
+     */
     CoreValue createValue(double value);
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#DOUBLE}.
+     *
+     * @param value The {@code double} that defines the new value.
+     * @return a new value instance.
+     */
     CoreValue createValue(long value);
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#BOOLEAN}.
+     *
+     * @param value The {@code boolean} that defines the new value.
+     * @return a new value instance.
+     */
     CoreValue createValue(boolean value);
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#DECIMAL}.
+     *
+     * @param value A non-null {@code BigDecimal} that defines the new value.
+     * @return a new value instance.
+     * @throws IllegalArgumentException if the specified {@code BigDecimal} is {@code null}.
+     */
     CoreValue createValue(BigDecimal value);
 
+    /**
+     * Creates a new value of type {@link javax.jcr.PropertyType#BINARY}.
+     *
+     * @param value A non-null {@code InputStream} that defines the new value.
+     * @return a new value instance.
+     * @throws IllegalArgumentException if the specified {@code InputStream} is {@code null}.
+     * @throws IOException If an error occurs while processing the stream.
+     * @throws //TODO define exceptions (currently impl. throws MikrokernelException)
+     */
     CoreValue createValue(InputStream value) throws IOException;
 
+    /**
+     * Creates a new value of the specified type.
+     *
+     * @param value A non-null {@code String} that defines the new value.
+     * @param type The desired target type of the new value.
+     * @return a new value instance.
+     * @throws IllegalArgumentException if the specified {@code value} is {@code null}
+     * or if the given type is not supported.
+     * @throws NumberFormatException If the specified {@code type} requires
+     * conversion to any of the number types and the conversion fails.
+     * @throws //TODO define and consolidate exceptions
+     */
     CoreValue createValue(String value, int type);
 }
\ No newline at end of file



Mime
View raw message