Package javax.jcr
Interface ValueFactory
-
- All Known Subinterfaces:
JackrabbitValueFactory
- All Known Implementing Classes:
AbstractValueFactory
,SimpleValueFactory
,ValueFactoryImpl
,ValueFactoryImpl
,ValueFactoryQImpl
public interface ValueFactory
TheValueFactory
object provides methods for the creation Value objects that can then be used to set properties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Binary
createBinary(java.io.InputStream stream)
Returns aBinary
object with a value consisting of the content of the specifiedInputStream
.Value
createValue(boolean value)
Value
createValue(double value)
Value
createValue(long value)
Value
createValue(java.io.InputStream value)
Deprecated.As of JCR 2.0,createValue(Binary)
should be used instead.Value
createValue(java.lang.String value)
Value
createValue(java.lang.String value, int type)
Value
createValue(java.math.BigDecimal value)
Value
createValue(java.util.Calendar value)
Value
createValue(Binary value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.Value
createValue(Node value)
Value
createValue(Node value, boolean weak)
Returns aValue
object ofPropertyType.REFERENCE
(ifweak
isfalse
) orPropertyType.REFERENCE
(ifweak
istrue
) that holds the identifier of the specifiedNode
.
-
-
-
Method Detail
-
createValue
Value createValue(java.lang.String value)
- Parameters:
value
- aString
- Returns:
- a
Value
ofPropertyType.STRING
-
createValue
Value createValue(java.lang.String value, int type) throws ValueFormatException
- Parameters:
value
- aString
type
- one of the constants defined inPropertyType
.- Returns:
- a
Value
ofPropertyType
type
. - Throws:
ValueFormatException
- if the specifiedvalue
cannot be converted to the specifiedtype
.
-
createValue
Value createValue(long value)
- Parameters:
value
- along
- Returns:
- a
Value
ofPropertyType.LONG
-
createValue
Value createValue(double value)
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DOUBLE
-
createValue
Value createValue(java.math.BigDecimal value)
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DECIMAL
- Since:
- JCR 2.0
-
createValue
Value createValue(boolean value)
- Parameters:
value
- aboolean
- Returns:
- a
Value
ofPropertyType.BOOLEAN
-
createValue
Value createValue(java.util.Calendar value)
- Parameters:
value
- aCalendar
- Returns:
- a
Value
ofPropertyType.DATE
- Throws:
java.lang.IllegalArgumentException
- if the specifiedvalue
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.
-
createValue
Value createValue(java.io.InputStream value)
Deprecated.As of JCR 2.0,createValue(Binary)
should be used instead.Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedInputStream
.The passed
InputStream
is closed before this method returns either normally or because of an exception.- Parameters:
value
- anInputStream
- Returns:
- a
Value
ofPropertyType.BINARY
-
createValue
Value createValue(Binary value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.- Parameters:
value
- aBinary
- Returns:
- a
Value
ofPropertyType.BINARY
- Since:
- JCR 2.0
-
createValue
Value createValue(Node value) throws RepositoryException
Returns aValue
object ofPropertyType.REFERENCE
that holds the identifier of the specifiedNode
. ThisValue
object can then be used to set a property that will be a reference to thatNode
.- Parameters:
value
- aNode
- Returns:
- a
Value
ofPropertyType.REFERENCE
- Throws:
RepositoryException
- if the specifiedNode
is not referenceable, the currentSession
is no longer active, or another error occurs.
-
createValue
Value createValue(Node value, boolean weak) throws RepositoryException
Returns aValue
object ofPropertyType.REFERENCE
(ifweak
isfalse
) orPropertyType.REFERENCE
(ifweak
istrue
) that holds the identifier of the specifiedNode
. ThisValue
object can then be used to set a property that will be a reference to thatNode
.- Parameters:
value
- aNode
weak
- aboolean
. If true then aPropertyType.WEAKREFERENCE
is created, otherwise aPropertyType.REFERENCE
is created.- Returns:
- a
Value
ofPropertyType.REFERENCE
orPropertyType.REFERENCE
- Throws:
RepositoryException
- if the specifiedNode
is not referenceable, the currentSession
is no longer active, or another error occurs.
-
createBinary
Binary createBinary(java.io.InputStream stream) throws RepositoryException
Returns aBinary
object with a value consisting of the content of the specifiedInputStream
.The passed
InputStream
is closed before this method returns either normally or because of an exception.- Parameters:
stream
- anInputStream
- Returns:
- a
Binary
- Throws:
RepositoryException
- if an error occurs.- Since:
- JCR 2.0
-
-