public class SerialValueFactory extends Object implements ValueFactory
SerialValueFactory class is used in the RMI infrastructure
to create serializable Value instances on the client side.
This class works in conjunction with the implementations of the
javax.jcr.Value interface found in this package.
This class may be extended to overwrite any of the
createXXXValue methods to create instances of the respective
type of Value implementation. The
methods of the ValueFactory interface are declared final to
guard against breaking the rules.
| Modifier | Constructor and Description |
|---|---|
protected |
SerialValueFactory()
Default constructor only visible to extensions of this class.
|
| Modifier and Type | Method and Description |
|---|---|
Binary |
createBinary(InputStream stream) |
Value |
createValue(BigDecimal value) |
Value |
createValue(Binary value) |
Value |
createValue(boolean value) |
Value |
createValue(Calendar value) |
Value |
createValue(double value) |
Value |
createValue(InputStream value) |
Value |
createValue(long value) |
Value |
createValue(Node value) |
Value |
createValue(Node value,
boolean weak) |
Value |
createValue(String value) |
Value |
createValue(String value,
int type) |
static SerialValueFactory |
getInstance()
Returns the
ValueFactory instance, which currently is a
singleton instance of this class. |
static Value |
makeSerialValue(Value value)
Utility method for decorating a value.
|
static Value[] |
makeSerialValueArray(String[] values)
Utility method for converting an array of strings to serializable
string values.
|
static Value[] |
makeSerialValueArray(Value[] values)
Utility method for decorating an array of values.
|
protected SerialValueFactory()
public static final SerialValueFactory getInstance()
ValueFactory instance, which currently is a
singleton instance of this class.
Future revisions will support some kind of configuration to specify which concrete class should be used.
public static Value[] makeSerialValueArray(Value[] values) throws RepositoryException
If the given array is null, then an empty array is
returned.
values - the values to be decoratedRepositoryException - if the values can not be serializedpublic static Value makeSerialValue(Value value) throws RepositoryException
value - the value to be decorated, or nullnullRepositoryException - if the value can not be serializedpublic static Value[] makeSerialValueArray(String[] values)
If the given array is null, then an empty array is
returned.
values - the string arraypublic Value createValue(String value)
createValue in interface ValueFactorypublic final Value createValue(String value, int type) throws ValueFormatException
createValue in interface ValueFactoryValueFormatExceptionpublic final Value createValue(long value)
createValue in interface ValueFactorypublic final Value createValue(double value)
createValue in interface ValueFactorypublic final Value createValue(boolean value)
createValue in interface ValueFactorypublic Value createValue(BigDecimal value)
createValue in interface ValueFactorypublic final Value createValue(Calendar value)
createValue in interface ValueFactorypublic final Value createValue(InputStream value)
createValue in interface ValueFactorypublic final Value createValue(Node value) throws RepositoryException
createValue in interface ValueFactoryRepositoryExceptionpublic Binary createBinary(InputStream stream) throws RepositoryException
createBinary in interface ValueFactoryRepositoryExceptionpublic Value createValue(Binary value)
createValue in interface ValueFactorypublic Value createValue(Node value, boolean weak) throws RepositoryException
createValue in interface ValueFactoryRepositoryExceptionCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.