public class SerialValueFactory extends Object implements javax.jcr.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 |
---|---|
javax.jcr.Binary |
createBinary(InputStream stream) |
javax.jcr.Value |
createValue(BigDecimal value) |
javax.jcr.Value |
createValue(javax.jcr.Binary value) |
javax.jcr.Value |
createValue(boolean value) |
javax.jcr.Value |
createValue(Calendar value) |
javax.jcr.Value |
createValue(double value) |
javax.jcr.Value |
createValue(InputStream value) |
javax.jcr.Value |
createValue(long value) |
javax.jcr.Value |
createValue(javax.jcr.Node value) |
javax.jcr.Value |
createValue(javax.jcr.Node value,
boolean weak) |
javax.jcr.Value |
createValue(String value) |
javax.jcr.Value |
createValue(String value,
int type) |
static SerialValueFactory |
getInstance()
Returns the
ValueFactory instance, which currently is a
singleton instance of this class. |
static javax.jcr.Value |
makeSerialValue(javax.jcr.Value value)
Utility method for decorating a value.
|
static javax.jcr.Value[] |
makeSerialValueArray(String[] values)
Utility method for converting an array of strings to serializable
string values.
|
static javax.jcr.Value[] |
makeSerialValueArray(javax.jcr.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 javax.jcr.Value[] makeSerialValueArray(javax.jcr.Value[] values) throws javax.jcr.RepositoryException
If the given array is null
, then an empty array is
returned.
values
- the values to be decoratedjavax.jcr.RepositoryException
- if the values can not be serializedpublic static javax.jcr.Value makeSerialValue(javax.jcr.Value value) throws javax.jcr.RepositoryException
value
- the value to be decorated, or null
null
javax.jcr.RepositoryException
- if the value can not be serializedpublic static javax.jcr.Value[] makeSerialValueArray(String[] values)
If the given array is null
, then an empty array is
returned.
values
- the string arraypublic javax.jcr.Value createValue(String value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(String value, int type) throws javax.jcr.ValueFormatException
createValue
in interface javax.jcr.ValueFactory
javax.jcr.ValueFormatException
public final javax.jcr.Value createValue(long value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(double value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(boolean value)
createValue
in interface javax.jcr.ValueFactory
public javax.jcr.Value createValue(BigDecimal value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(Calendar value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(InputStream value)
createValue
in interface javax.jcr.ValueFactory
public final javax.jcr.Value createValue(javax.jcr.Node value) throws javax.jcr.RepositoryException
createValue
in interface javax.jcr.ValueFactory
javax.jcr.RepositoryException
public javax.jcr.Binary createBinary(InputStream stream) throws javax.jcr.RepositoryException
createBinary
in interface javax.jcr.ValueFactory
javax.jcr.RepositoryException
public javax.jcr.Value createValue(javax.jcr.Binary value)
createValue
in interface javax.jcr.ValueFactory
public javax.jcr.Value createValue(javax.jcr.Node value, boolean weak) throws javax.jcr.RepositoryException
createValue
in interface javax.jcr.ValueFactory
javax.jcr.RepositoryException
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.