Class QValueFactoryLogger
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.logging.AbstractLogger
-
- org.apache.jackrabbit.spi.commons.logging.QValueFactoryLogger
-
- All Implemented Interfaces:
QValueFactory
public class QValueFactoryLogger extends AbstractLogger implements QValueFactory
Log wrapper for aQValueFactory
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
AbstractLogger.Callable, AbstractLogger.SafeCallable
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
writer
-
-
Constructor Summary
Constructors Constructor Description QValueFactoryLogger(QValueFactory qValueFactory, LogWriter writer)
Create a new instance for the givenqValueFactory
which useswriter
for persisting log messages.
-
Method Summary
All Methods Instance Methods Concrete 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(File value)
Create a newQValue
with typePropertyType.BINARY
.QValue
create(InputStream value)
Creates a QValue that contains the given binary stream.QValue
create(String value, int type)
Create a newQValue
using the given String representation of the value and itstype
.QValue
create(BigDecimal value)
Create a newQValue
with typePropertyType.DECIMAL
.QValue
create(URI value)
Create a newQValue
with typePropertyType.URI
.QValue
create(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
.QValueFactory
getQValueFactory()
-
Methods inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
execute, execute
-
-
-
-
Constructor Detail
-
QValueFactoryLogger
public QValueFactoryLogger(QValueFactory qValueFactory, LogWriter writer)
Create a new instance for the givenqValueFactory
which useswriter
for persisting log messages.- Parameters:
qValueFactory
-writer
-
-
-
Method Detail
-
getQValueFactory
public QValueFactory getQValueFactory()
- Returns:
- the wrapped QValueFactory
-
create
public QValue create(String value, int type) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
using the given String representation of the value and itstype
.- Specified by:
create
in interfaceQValueFactory
- 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
public QValue create(Calendar value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.DATE
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- A non-nullCalendar
object acting as value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(double value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.DOUBLE
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- Adouble
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(long value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.LONG
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- Along
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(boolean value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.BOOLEAN
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- Aboolean
containing the value of the newQValue
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(Name value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.NAME
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- A non-nullName
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(Path value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.PATH
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- A non-nullPath
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(URI value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.URI
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- A non-nullURI
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(BigDecimal value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.DECIMAL
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- A non-nullBigDecimal
.- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(byte[] value) throws RepositoryException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.BINARY
.- Specified by:
create
in interfaceQValueFactory
- Returns:
- a new
QValue
. - Throws:
RepositoryException
-
create
public QValue create(InputStream value) throws RepositoryException, IOException
Description copied from interface:QValueFactory
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
.- Specified by:
create
in interfaceQValueFactory
- Parameters:
value
- binary stream- Returns:
- a new binary
QValue
. - Throws:
RepositoryException
- if the value could not be createdIOException
- if the stream can not be consumed
-
create
public QValue create(File value) throws RepositoryException, IOException
Description copied from interface:QValueFactory
Create a newQValue
with typePropertyType.BINARY
.- Specified by:
create
in interfaceQValueFactory
- Returns:
- a new binary
QValue
. - Throws:
IOException
RepositoryException
-
computeAutoValues
public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException
Description copied from interface:QValueFactory
Given theQPropertyDefinition
of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.- Specified by:
computeAutoValues
in interfaceQValueFactory
- Parameters:
propertyDefinition
- definition of property for which values should be created- Returns:
- computed value
- Throws:
RepositoryException
-
-