Class ValueFactoryQImpl
java.lang.Object
org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl
- All Implemented Interfaces:
ValueFactory
This class implements the
ValueFactory
interface,
wrapping an existing SPI QValueFactory
and a
NamePathResolver
.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValueFactoryQImpl
(QValueFactory qfactory, NamePathResolver resolver) Constructs a newValueFactoryQImpl
based on an existing SPIQValueFactory
and aNamePathResolver
. -
Method Summary
Modifier and TypeMethodDescriptioncreateBinary
(InputStream stream) Returns aBinary
object with a value consisting of the content of the specifiedInputStream
.createValue
(boolean value) createValue
(double value) createValue
(long value) createValue
(InputStream value) Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedInputStream
.createValue
(String value) createValue
(String value, int type) createValue
(BigDecimal value) createValue
(Calendar value) createValue
(Binary value) Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.createValue
(Node value) createValue
(Node value, boolean weak) Returns aValue
object ofPropertyType.REFERENCE
(ifweak
isfalse
) orPropertyType.REFERENCE
(ifweak
istrue
) that holds the identifier of the specifiedNode
.createValue
(QValue qvalue) Create a newValue
based on an existingQValue
TheQValueFactory
that is wrapped by thisValueFactory
instance.
-
Constructor Details
-
ValueFactoryQImpl
Constructs a newValueFactoryQImpl
based on an existing SPIQValueFactory
and aNamePathResolver
.- Parameters:
qfactory
- wrappedQValueFactory
resolver
- wrappedNamePathResolver
-
-
Method Details
-
getQValueFactory
TheQValueFactory
that is wrapped by thisValueFactory
instance.- Returns:
- qfactory The
QValueFactory
wrapped by this instance.
-
createValue
Create a newValue
based on an existingQValue
- Parameters:
qvalue
- existingQValue
- Returns:
- a
Value
representing theQValue
-
createValue
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aString
- Returns:
- a
Value
ofPropertyType.STRING
-
createValue
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- along
- Returns:
- a
Value
ofPropertyType.LONG
-
createValue
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DOUBLE
-
createValue
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aboolean
- Returns:
- a
Value
ofPropertyType.BOOLEAN
-
createValue
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aCalendar
- Returns:
- a
Value
ofPropertyType.DATE
-
createValue
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.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- anInputStream
- Returns:
- a
Value
ofPropertyType.BINARY
-
createValue
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
.- Specified by:
createValue
in interfaceValueFactory
- 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
- Specified by:
createValue
in interfaceValueFactory
- 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
.
-
createBinary
Description copied from interface:ValueFactory
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.- Specified by:
createBinary
in interfaceValueFactory
- Parameters:
stream
- anInputStream
- Returns:
- a
Binary
- Throws:
RepositoryException
- if an error occurs.
-
createValue
Description copied from interface:ValueFactory
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aBinary
- Returns:
- a
Value
ofPropertyType.BINARY
-
createValue
Description copied from interface:ValueFactory
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DECIMAL
-
createValue
Description copied from interface:ValueFactory
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
.- Specified by:
createValue
in interfaceValueFactory
- 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.
-