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 2006/01/03 12:36:49 UTC
svn commit: r365608 - in
/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi:
server/ value/
Author: jukka
Date: Tue Jan 3 03:36:30 2006
New Revision: 365608
URL: http://svn.apache.org/viewcvs?rev=365608&view=rev
Log:
JCR-97: Improve checkstyle conformance in JCR-RMI.
Modified:
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BinaryValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BooleanValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DateValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DoubleValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/InitialValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/LongValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/NameValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/PathValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/ReferenceValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValue.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StatefulValueAdapter.java
incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StringValue.java
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java Tue Jan 3 03:36:30 2006
@@ -88,7 +88,7 @@
* <p>
* The <code>bufferSize</code> property can be used to configure the
* size of the buffer used by iterators to speed up iterator traversal
- * over the network.
+ * over the network.
*
* @author Jukka Zitting
* @author Philipp Koch
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BinaryValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BinaryValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BinaryValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BinaryValue.java Tue Jan 3 03:36:30 2006
@@ -187,8 +187,7 @@
* data is copied.
* @throws IOException If an error occurrs writing the binary data.
*/
- private void writeObject(ObjectOutputStream out)
- throws IOException, OutOfMemoryError {
+ private void writeObject(ObjectOutputStream out) throws IOException {
byte[] buffer = new byte[4096];
int bytes = 0;
while ((bytes = stream.read(buffer)) >= 0) {
@@ -210,8 +209,7 @@
* binary data.
* @throws IOException If an error occurrs reading the binary data.
*/
- private void readObject(ObjectInputStream in)
- throws IOException, OutOfMemoryError {
+ private void readObject(ObjectInputStream in) throws IOException {
final File file = File.createTempFile("jcr-value", "bin");
OutputStream out = new FileOutputStream(file);
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BooleanValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BooleanValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BooleanValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/BooleanValue.java Tue Jan 3 03:36:30 2006
@@ -23,8 +23,8 @@
/**
* The <code>BooleanValue</code> class implements the committed value state for
* Boolean values as a part of the State design pattern (Gof) used by this
- * package.
- *
+ * package.
+ *
* @since 0.16.4.1
* @see org.apache.jackrabbit.rmi.value.SerialValue
*/
@@ -52,7 +52,7 @@
protected BooleanValue(String value) {
this(toBoolean(value));
}
-
+
/**
* Returns the boolean value represented by the string <code>value</code>.
* <p>
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DateValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DateValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DateValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DateValue.java Tue Jan 3 03:36:30 2006
@@ -35,7 +35,7 @@
* <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code>. The issue with this pattern is that
* the era specification as defined in the JCR specification (+/- prefix) as
* well as full time zone naming are not supported.
- *
+ *
* @since 0.16.4.1
* @see org.apache.jackrabbit.rmi.value.SerialValue
*/
@@ -52,9 +52,9 @@
* This should probably actually be a reference to the ISO8601 utility
* class.
*/
- private static final DateFormat DATE_FORMAT =
+ private static final DateFormat DATE_FORMAT =
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
-
+
/**
* Creates an instance for the given <code>Calendar</code> <code>value</code>.
*/
@@ -78,7 +78,7 @@
/**
* Returns the string <code>value</code> parsed into a
* <code>Calendar</code> instance.
- *
+ *
* @param value The string value.
* @return The <code>Calendar</code> instance parsed from the string
* value.
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DoubleValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DoubleValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DoubleValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/DoubleValue.java Tue Jan 3 03:36:30 2006
@@ -25,8 +25,8 @@
/**
* The <code>DoubleValue</code> class implements the committed value state for
* Double values as a part of the State design pattern (Gof) used by this
- * package.
- *
+ * package.
+ *
* @since 0.16.4.1
* @see org.apache.jackrabbit.rmi.value.SerialValue
*/
@@ -51,7 +51,7 @@
* <p>
* This implementation uses the <code>Double.valueOf(String)</code> method
* to convert the string to a double.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> cannot be
* parsed to double.
*/
@@ -61,7 +61,7 @@
/**
* Returns the double value represented by the string <code>value</code>.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> cannot be
* parsed to double.
*/
@@ -82,14 +82,14 @@
/**
* Returns a <code>Calendar</code> instance interpreting the double as the
- * time in milliseconds since the epoch (1.1.1970, 0:00, UTC).
+ * time in milliseconds since the epoch (1.1.1970, 0:00, UTC).
*/
public Calendar getDate() throws ValueFormatException {
Calendar date = Calendar.getInstance();
date.setTimeInMillis((long) value);
return date;
}
-
+
/**
* Returns the double value.
*/
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/InitialValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/InitialValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/InitialValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/InitialValue.java Tue Jan 3 03:36:30 2006
@@ -24,7 +24,6 @@
import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
-import javax.jcr.Value;
import javax.jcr.ValueFormatException;
/**
@@ -109,7 +108,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getStream();
}
@@ -121,7 +120,7 @@
* general value getter method.
*
* @return string value
- *
+ *
* @throws ValueFormatException if conversion to string is not possible
* @throws IllegalStateException not thrown by proper instances
* @throws RepositoryException if another error occurs
@@ -134,7 +133,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getString();
}
@@ -158,7 +157,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getLong();
}
@@ -182,7 +181,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getDouble();
}
@@ -206,7 +205,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getDate();
}
@@ -230,7 +229,7 @@
} else {
realValue = value;
}
-
+
general.setValue(realValue);
return realValue.getBoolean();
}
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/LongValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/LongValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/LongValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/LongValue.java Tue Jan 3 03:36:30 2006
@@ -25,8 +25,8 @@
/**
* The <code>LongValue</code> class implements the committed value state for
* Long values as a part of the State design pattern (Gof) used by this
- * package.
- *
+ * package.
+ *
* @since 0.16.4.1
* @see org.apache.jackrabbit.rmi.value.SerialValue
*/
@@ -51,7 +51,7 @@
* <p>
* This implementation uses the <code>Long.valueOf(String)</code> method
* to convert the string to a long.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> cannot be
* parsed to long.
*/
@@ -82,14 +82,14 @@
/**
* Returns a <code>Calendar</code> instance interpreting the long as the
- * time in milliseconds since the epoch (1.1.1970, 0:00, UTC).
+ * time in milliseconds since the epoch (1.1.1970, 0:00, UTC).
*/
public Calendar getDate() throws ValueFormatException {
Calendar date = Calendar.getInstance();
date.setTimeInMillis((long) value);
return date;
}
-
+
/**
* Returns the double value.
*/
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/NameValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/NameValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/NameValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/NameValue.java Tue Jan 3 03:36:30 2006
@@ -24,8 +24,8 @@
/**
* The <code>NameValue</code> class implements the committed value state for
- * Name values as a part of the State design pattern (Gof) used by this package.
- *
+ * Name values as a part of the State design pattern (Gof) used by this package.
+ *
* @author Felix Meschberger
* @since 0.16.4.1
*/
@@ -37,22 +37,22 @@
/** The name value. */
private final String value;
-
+
/**
* Creates an instance for the given name <code>value</code>.
*/
protected NameValue(String value) throws ValueFormatException {
this.value = toName(value);
}
-
+
/**
* Checks whether the string value adheres to the name syntax.
- *
+ *
* @param value The string to check for synthactical compliance with a
* name value.
- *
+ *
* @return The input value.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> is not a
* synthactically correct name.
*/
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/PathValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/PathValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/PathValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/PathValue.java Tue Jan 3 03:36:30 2006
@@ -24,8 +24,8 @@
/**
* The <code>PathValue</code> class implements the committed value state for
- * Path values as a part of the State design pattern (Gof) used by this package.
- *
+ * Path values as a part of the State design pattern (Gof) used by this package.
+ *
* @author Felix Meschberger
* @since 0.16.4.1
*/
@@ -37,22 +37,22 @@
/** The path value. */
private final String value;
-
+
/**
* Creates an instance for the given path <code>value</code>.
*/
protected PathValue(String value) throws ValueFormatException {
this.value = toPath(value);
}
-
+
/**
* Checks whether the string value adheres to the path syntax.
- *
+ *
* @param value The string to check for synthactical compliance with a
* path value.
- *
+ *
* @return The input value.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> is not a
* synthactically correct path.
*/
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/ReferenceValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/ReferenceValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/ReferenceValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/ReferenceValue.java Tue Jan 3 03:36:30 2006
@@ -25,8 +25,8 @@
/**
* The <code>ReferenceValue</code> class implements the committed value state
* for Reference values as a part of the State design pattern (Gof) used by
- * this package.
- *
+ * this package.
+ *
* @author Felix Meschberger
* @since 0.16.4.1
*/
@@ -38,22 +38,22 @@
/** The reference value */
private final String value;
-
+
/**
* Creates an instance for the given reference <code>value</code>.
*/
protected ReferenceValue(String value) throws ValueFormatException {
this.value = toReference(value);
}
-
+
/**
* Checks whether the string value adheres to the reference syntax.
- *
+ *
* @param value The string to check for synthactical compliance with a
* reference value.
- *
+ *
* @return The input value.
- *
+ *
* @throws ValueFormatException if the string <code>value</code> is not a
* synthactically correct reference.
*/
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValue.java Tue Jan 3 03:36:30 2006
@@ -39,7 +39,7 @@
/** Static serial version UID. */
static final long serialVersionUID = 6970955308427991717L;
-
+
/**
* Type of the underlying value. Note that this type is never changed
* even if the value state changes. Thus the type is memorized in this
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/SerialValueFactory.java Tue Jan 3 03:36:30 2006
@@ -38,7 +38,7 @@
* type of {@link org.apache.jackrabbit.rmi.value.StatefullValue}implementation. The
* methods of the <code>ValueFactory</code> interface are declared final to
* guard against breaking the rules.
- *
+ *
* @version $Revision$, $Date$
* @author Jukka Zitting
* @author Felix Meschberger
@@ -48,7 +48,7 @@
/** The singleton value factory instance */
private static final SerialValueFactory INSTANCE = new SerialValueFactory();
-
+
/**
* Returns the <code>ValueFactory</code> instance, which currently is a
* singleton instance of this class.
@@ -68,7 +68,7 @@
* <p>
* If the given array is <code>null</code>, then an empty array is
* returned.
- *
+ *
* @param values the values to be decorated
* @return array of decorated values
*/
@@ -87,7 +87,7 @@
/**
* Utility method for decorating a value. Note that the contents of the
* original values will only be copied when the decorators are serialized.
- *
+ *
* @param value the value to be decorated
* @return the decorated value
*/
@@ -106,8 +106,9 @@
* Default constructor only visible to extensions of this class. See
* class comments for details.
*/
- protected SerialValueFactory() {}
-
+ protected SerialValueFactory() {
+ }
+
/** {@inheritDoc} */
public final Value createValue(String value) {
return new SerialValue(createStringValue(value));
@@ -147,7 +148,7 @@
default:
throw new ValueFormatException("Unknown type " + type);
}
-
+
return new SerialValue(intValue);
}
@@ -180,31 +181,31 @@
public final Value createValue(Node value) throws RepositoryException {
return createValue(value.getUUID(), PropertyType.REFERENCE);
}
-
+
//---------- API to overwrite to use extended classes ----------------------
-
+
/**
* Creates an instance of the {@link StringValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link StringValue#StringValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string making up the value itself.
*/
protected StringValue createStringValue(String value) {
return new StringValue(value);
}
-
+
/**
* Creates an instance of the {@link NameValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link NameValue#NameValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string making up the value itself.
- *
+ *
* @throws ValueFormatException if the string is not a synthactically
* correct JCR name.
*/
@@ -212,16 +213,16 @@
throws ValueFormatException {
return new NameValue(value);
}
-
+
/**
* Creates an instance of the {@link PathValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link PathValue#PathValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string making up the value itself.
- *
+ *
* @throws ValueFormatException if the string is not a synthactically
* correct JCR path.
*/
@@ -229,16 +230,16 @@
throws ValueFormatException {
return new PathValue(value);
}
-
+
/**
* Creates an instance of the {@link ReferenceValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link ReferenceValue#ReferenceValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string making up the value itself.
- *
+ *
* @throws ValueFormatException if the string is not a synthactically
* correct JCR reference.
*/
@@ -246,82 +247,80 @@
throws ValueFormatException {
return new ReferenceValue(value);
}
-
+
/**
* Creates an instance of the {@link LongValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link LongValue#LongValue(long)}
* with the long <code>value</code>.
- *
+ *
* @param value The long making up the value itself.
*/
protected LongValue createLongValue(long value) {
return new LongValue(value);
}
-
+
/**
* Creates an instance of the {@link LongValue} class or an extension
* thereof from the string representation of the <code>long</code> number.
* <p>
* This implementation just calls {@link LongValue#LongValue(String)} with
* the string <code>value</code>.
- *
+ *
* @param value The string representation of the <code>long</code> number
* making up the value itself.
- *
+ *
* @throws ValueFormatException if the string cannot be converted to a
* long number.
*/
protected LongValue createLongValue(String value) throws ValueFormatException {
return new LongValue(value);
}
-
+
/**
* Creates an instance of the {@link DoubleValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link DoubleValue#DoubleValue(double)}
* with the double <code>value</code>.
- *
+ *
* @param value The double making up the value itself.
*/
protected DoubleValue createDoubleValue(double value) {
return new DoubleValue(value);
}
-
-
+
/**
* Creates an instance of the {@link DoubleValue} class or an extension
* thereof from the string representation of the <code>double</code> number.
* <p>
* This implementation just calls {@link DoubleValue#DoubleValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string representation of the <code>long</code> number
* making up the value itself.
- *
+ *
* @throws ValueFormatException if the string cannot be converted to a
* double number.
*/
protected DoubleValue createDoubleValue(String value) throws ValueFormatException {
return new DoubleValue(value);
}
-
+
/**
* Creates an instance of the {@link DateValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link DateValue#DateValue(Calendar)}
* with the <code>Calendar</code> <code>value</code>.
- *
+ *
* @param value The <code>Calendar</code> making up the value itself.
*/
protected DateValue createDateValue(Calendar value) {
return new DateValue(value);
}
-
-
+
/**
* Creates an instance of the {@link DateValue} class or an extension
* thereof from the string representation of <code>Calendar</code>
@@ -329,61 +328,60 @@
* <p>
* This implementation just calls {@link DateValue#DateValue(String)} with
* the string <code>value</code>.
- *
+ *
* @param value The string representation of the <code>Calendar</code>
* instance making up the value itself.
- *
+ *
* @throws ValueFormatException if the string cannot be converted to a
* <code>Calendar</code> instance.
*/
protected DateValue createDateValue(String value) throws ValueFormatException {
return new DateValue(value);
}
-
+
/**
* Creates an instance of the {@link BooleanValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link BooleanValue#BooleanValue(boolean)}
* with the boolean <code>value</code>.
- *
+ *
* @param value The boolean making up the value itself.
*/
protected BooleanValue createBooleanValue(boolean value) {
return new BooleanValue(value);
}
-
-
+
/**
* Creates an instance of the {@link BooleanValue} class or an extension
* thereof from the string representation of the <code>boolean</code>.
* <p>
* This implementation just calls {@link BooleanValue#BooleanValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string representation of the <code>boolean</code>
* making up the value itself.
- *
+ *
* @throws ValueFormatException if the string cannot be converted to a
* long number.
*/
protected BooleanValue createBooleanValue(String value) {
return new BooleanValue(value);
}
-
+
/**
* Creates an instance of the {@link BinaryValue} class or an extension
* thereof.
* <p>
* This implementation just calls {@link BinaryValue#BinaryValue(InputStream)}
* with the <code>InputStream</code> <code>value</code>.
- *
+ *
* @param value The <code>InputStream</code> making up the value itself.
*/
protected BinaryValue createBinaryValue(InputStream value) {
return new BinaryValue(value);
}
-
+
/**
* Creates an instance of the {@link BinaryValue} class or an extension
* thereof from the string whose UTF-8 representation is used as the
@@ -391,14 +389,15 @@
* <p>
* This implementation just calls {@link BinaryValue#BinaryValue(String)}
* with the string <code>value</code>.
- *
+ *
* @param value The string whose UTF-8 representation is making up the value
* itself.
- *
+ *
* @throws ValueFormatException if the UTF-8 representation of the string
* cannot be created.
*/
protected BinaryValue createBinaryValue(String value) throws ValueFormatException {
return new BinaryValue(value);
}
+
}
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StatefulValueAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StatefulValueAdapter.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StatefulValueAdapter.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StatefulValueAdapter.java Tue Jan 3 03:36:30 2006
@@ -52,11 +52,11 @@
/** The delegatee value. */
private Value delegatee;
-
+
/**
* Creates an instance adapting the given JCR <code>Value</code> to the
* State design pattern.
- *
+ *
* @param delegatee The JCR <code>Value</code> providing the value date.
*/
StatefulValueAdapter(Value delegatee) {
@@ -105,21 +105,21 @@
* from the delegatee, which is then written. The newly created
* {@link StatefullValue} value also replaces the original delegatee
* internally.
- *
+ *
* @param out The destination to write the delegatee to.
- *
+ *
* @throws IOException If an error occurrs writing the value or if an
* error occurrs creating the {@link StatefullValue} from the
* delegatee.
*/
private void writeObject(ObjectOutputStream out) throws IOException {
// if the delegatee value is a StatefullValue or SerialValue, serialize it
- if (delegatee instanceof StatefulValue ||
- delegatee instanceof SerialValue) {
+ if (delegatee instanceof StatefulValue
+ || delegatee instanceof SerialValue) {
out.writeObject(delegatee);
return;
}
-
+
// otherwise create a SerialValue from the delegatee value to send
try {
SerialValueFactory factory = SerialValueFactory.getInstance();
@@ -158,33 +158,34 @@
// replace the delegatee with the new one
delegatee = toSend;
-
+
// and finally send the serial value instance
out.writeObject(toSend);
} catch (RepositoryException ex) {
throw new IOException(ex.getMessage());
}
}
-
+
/**
* Reads an reconstructs the delegatee from the given
* <code>ObjectInputStream</code>. The value read will either be an
* instance of {@link SerialValue} or a {@link StatefullValue} depending
* on the original delegatee written.
- *
+ *
* @param in The <code>ObjectInputStream</code> from which to read the
* delegatee.
- *
+ *
* @throws IOException If an error occurrs reading from the
* <code>ObjectInputStream</code> or if the runtime class of the
- * value to be read cannot be found.
+ * value to be read cannot be found.
*/
private void readObject(ObjectInputStream in) throws IOException {
try {
delegatee = (Value) in.readObject();
} catch (ClassNotFoundException cnfe) {
- throw new IOException("Cannot load value object class: " +
- cnfe.getMessage());
+ throw new IOException(
+ "Cannot load value object class: " + cnfe.getMessage());
}
}
+
}
Modified: incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StringValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StringValue.java?rev=365608&r1=365607&r2=365608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StringValue.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-rmi/src/java/org/apache/jackrabbit/rmi/value/StringValue.java Tue Jan 3 03:36:30 2006
@@ -25,8 +25,8 @@
/**
* The <code>StringValue</code> class implements the committed value state for
* String values as a part of the State design pattern (Gof) used by this
- * package.
- *
+ * package.
+ *
* @since 0.16.4.1
* @see org.apache.jackrabbit.rmi.value.SerialValue
*/
@@ -63,7 +63,7 @@
/**
* Returns the string value parsed to a long calling the
* <code>Long.valueOf(String)</code> method.
- *
+ *
* @throws ValueFormatException if the string cannot be parsed to long.
*/
public long getLong() throws ValueFormatException {
@@ -73,7 +73,7 @@
/**
* Returns the string value parsed to a double calling the
* <code>Double.valueOf(String)</code> method.
- *
+ *
* @throws ValueFormatException if the string cannot be parsed to double.
*/
public double getDouble() throws ValueFormatException {
@@ -84,7 +84,7 @@
* Returns the string value parsed to a <code>Calendar</code> using the
* same formatter as the {@link DateValue} class. This formatting bears the
* same issues as parsing and formatting that class.
- *
+ *
* @throws ValueFormatException if the string cannot be parsed into a
* <code>Calendar</code> instance.
*/