Package org.apache.jackrabbit.spi
Interface QValueFactory
-
- All Known Implementing Classes:
AbstractQValueFactory
,QValueFactoryImpl
,QValueFactoryLogger
public interface QValueFactory
QValueFactory
defines methods to createQValue
instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QValue[]
computeAutoValues(QPropertyDefinition propertyDefinition)
Given theQPropertyDefinition
of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.QValue
create(boolean value)
Create a newQValue
with typePropertyType.BOOLEAN
.QValue
create(byte[] value)
Create a newQValue
with typePropertyType.BINARY
.QValue
create(double value)
Create a newQValue
with typePropertyType.DOUBLE
.QValue
create(long value)
Create a newQValue
with typePropertyType.LONG
.QValue
create(java.io.File value)
Create a newQValue
with typePropertyType.BINARY
.QValue
create(java.io.InputStream value)
Creates a QValue that contains the given binary stream.QValue
create(java.lang.String value, int type)
Create a newQValue
using the given String representation of the value and itstype
.QValue
create(java.math.BigDecimal value)
Create a newQValue
with typePropertyType.DECIMAL
.QValue
create(java.net.URI value)
Create a newQValue
with typePropertyType.URI
.QValue
create(java.util.Calendar value)
Create a newQValue
with typePropertyType.DATE
.QValue
create(Name value)
Create a newQValue
with typePropertyType.NAME
.QValue
create(Path value)
Create a newQValue
with typePropertyType.PATH
.
-
-
-
Method Detail
-
create
QValue create(java.lang.String value, int type) throws ValueFormatException, RepositoryException
Create a newQValue
using the given String representation of the value and itstype
.- Parameters:
value
- String representation of the newQValue
. Note, that the given String must never benull
.type
- A validtype
.- Returns:
- a new
QValue
. - Throws:
ValueFormatException
- If the givenvalue
cannot be converted to the specifiedtype
.RepositoryException
- If another error occurs.- See Also:
QValue.getType()
-
create
QValue create(java.util.Calendar value) throws RepositoryException
Create a newQValue
with typePropertyType.DATE
.- Parameters:
value
- A non-nullCalendar
object acting as value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(double value) throws RepositoryException
Create a newQValue
with typePropertyType.DOUBLE
.- Parameters:
value
- Adouble
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(long value) throws RepositoryException
Create a newQValue
with typePropertyType.LONG
.- Parameters:
value
- Along
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(boolean value) throws RepositoryException
Create a newQValue
with typePropertyType.BOOLEAN
.- Parameters:
value
- Aboolean
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(Name value) throws RepositoryException
Create a newQValue
with typePropertyType.NAME
.- Parameters:
value
- A non-nullName
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(Path value) throws RepositoryException
Create a newQValue
with typePropertyType.PATH
.- Parameters:
value
- A non-nullPath
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(java.math.BigDecimal value) throws RepositoryException
Create a newQValue
with typePropertyType.DECIMAL
.- Parameters:
value
- A non-nullBigDecimal
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(java.net.URI value) throws RepositoryException
Create a newQValue
with typePropertyType.URI
.- Parameters:
value
- A non-nullURI
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(byte[] value) throws RepositoryException
Create a newQValue
with typePropertyType.BINARY
.- Parameters:
value
-- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
QValue create(java.io.InputStream value) throws RepositoryException, java.io.IOException
Creates a QValue that contains the given binary stream. The given stream is consumed and closed by this method. The type of the resulting QValue will bePropertyType.BINARY
.- Parameters:
value
- binary stream- Returns:
- a new binary
QValue
. - Throws:
RepositoryException
- if the value could not be createdjava.io.IOException
- if the stream can not be consumed
-
create
QValue create(java.io.File value) throws RepositoryException, java.io.IOException
Create a newQValue
with typePropertyType.BINARY
.- Parameters:
value
-- Returns:
- a new binary
QValue
. - Throws:
java.io.IOException
RepositoryException
-
computeAutoValues
QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException
Given theQPropertyDefinition
of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.- Parameters:
propertyDefinition
- definition of property for which values should be created- Returns:
- computed value
- Throws:
RepositoryException
-
-