Copyright© 2008-2022 Sitevision AB, all rights reserved.
public interface ValueFactory
ValueFactory
object provides methods for the creation Value
objects that can then be used to set properties.Modifier and Type | Method and Description |
---|---|
Binary |
createBinary(InputStream stream)
Returns a
Binary object with a value consisting of the
content of the specified InputStream . |
Value |
createValue(BigDecimal value)
|
Value |
createValue(Binary value)
Returns a
Value object of PropertyType.BINARY
with a value consisting of the content of the specified
Binary . |
Value |
createValue(boolean value)
|
Value |
createValue(Calendar value)
|
Value |
createValue(double value)
|
Value |
createValue(InputStream value)
Deprecated.
As of JCR 2.0,
createValue(Binary) should be used
instead. |
Value |
createValue(long value)
|
Value |
createValue(Node value)
|
Value |
createValue(Node value,
boolean weak)
Returns a
Value object of PropertyType.REFERENCE (if
weak is false ) or PropertyType.REFERENCE (if weak is true ) that
holds the identifier of the specified Node . |
Value |
createValue(String value)
|
Value |
createValue(String value,
int type)
|
Value createValue(String value)
value
- a String
Value
of PropertyType.STRING
Value createValue(String value, int type) throws ValueFormatException
Value
object of the PropertyType
specified
by type
with the specified value
.
Sitevision note: Unsupported operation
value
- a String
type
- one of the constants defined in PropertyType
.Value
of PropertyType
type
.ValueFormatException
- if the specified value
cannot
be converted to the specified type
.Value createValue(long value)
value
- a long
Value
of PropertyType.LONG
Value createValue(double value)
value
- a double
Value
of PropertyType.DOUBLE
Value createValue(BigDecimal value)
value
- a double
Value
of PropertyType.DECIMAL
Value createValue(boolean value)
value
- a boolean
Value
of PropertyType.BOOLEAN
Value createValue(Calendar value)
value
- a Calendar
Value
of PropertyType.DATE
IllegalArgumentException
- if the specified value
cannot be expressed in the ISO 8601-based format defined in the JCR 2.0
specification and the implementation does not support dates incompatible
with that format.@Deprecated Value createValue(InputStream value)
createValue(Binary)
should be used
instead.Value
object of PropertyType.BINARY
with a value consisting of the content of the specified
InputStream
.
The passed InputStream
is closed before this method returns
either normally or because of an exception.
Sitevision note: Unsupported operation
value
- an InputStream
Value
of PropertyType.BINARY
Value createValue(Binary value)
Value
object of PropertyType.BINARY
with a value consisting of the content of the specified
Binary
.
Sitevision note: Unsupported operation
value
- a Binary
Value
of PropertyType.BINARY
Value createValue(Node value) throws RepositoryException
Value
object of PropertyType.REFERENCE
that holds the identifier of the specified Node
. This
Value
object can then be used to set a property that will be
a reference to that Node
.value
- a Node
Value
of PropertyType.REFERENCE
RepositoryException
- if the specified Node
is not
referenceable, the current Session
is no longer active, or
another error occurs.Value createValue(Node value, boolean weak) throws RepositoryException
Value
object of PropertyType.REFERENCE
(if
weak
is false
) or PropertyType.REFERENCE
(if weak
is true
) that
holds the identifier of the specified Node
. This
Value
object can then be used to set a property that will be
a reference to that Node
.
Sitevision note: Unsupported operation
value
- a Node
weak
- a boolean
. If true then a PropertyType.WEAKREFERENCE
is created, otherwise a PropertyType.REFERENCE
is created.Value
of PropertyType.REFERENCE
or PropertyType.REFERENCE
RepositoryException
- if the specified Node
is not
referenceable, the current Session
is no longer active, or
another error occurs.Binary createBinary(InputStream stream) throws RepositoryException
Binary
object with a value consisting of the
content of the specified InputStream
.
The passed InputStream
is closed before this method returns
either normally or because of an exception.
Sitevision note: Unsupported operation
stream
- an InputStream
Binary
RepositoryException
- if an error occurs.Sitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.