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 StringValue of PropertyType.STRINGValue 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 Stringtype - 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 longValue of PropertyType.LONGValue createValue(double value)
value - a doubleValue of PropertyType.DOUBLEValue createValue(BigDecimal value)
value - a doubleValue of PropertyType.DECIMALValue createValue(boolean value)
value - a booleanValue of PropertyType.BOOLEANValue createValue(Calendar value)
value - a CalendarValue of PropertyType.DATEIllegalArgumentException - 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 InputStreamValue of PropertyType.BINARYValue 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 BinaryValue of PropertyType.BINARYValue 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 NodeValue of PropertyType.REFERENCERepositoryException - 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 Nodeweak - a boolean. If true then a PropertyType.WEAKREFERENCE is created, otherwise a PropertyType.REFERENCE is created.Value of PropertyType.REFERENCE or PropertyType.REFERENCERepositoryException - 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 InputStreamBinaryRepositoryException - 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.