org.apache.jackrabbit.spi
Interface QValueFactory

All Known Implementing Classes:
AbstractQValueFactory, InternalValueFactory, QValueFactoryImpl, QValueFactoryLogger

public interface QValueFactory

QValueFactory defines methods to create QValue instances.


Method Summary
 QValue[] computeAutoValues(QPropertyDefinition propertyDefinition)
          Given the QPropertyDefinition of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.
 QValue create(BigDecimal value)
          Create a new QValue with type PropertyType.DECIMAL.
 QValue create(boolean value)
          Create a new QValue with type PropertyType.BOOLEAN.
 QValue create(byte[] value)
          Create a new QValue with type PropertyType.BINARY.
 QValue create(Calendar value)
          Create a new QValue with type PropertyType.DATE.
 QValue create(double value)
          Create a new QValue with type PropertyType.DOUBLE.
 QValue create(File value)
          Create a new QValue with type PropertyType.BINARY.
 QValue create(InputStream value)
          Creates a QValue that contains the given binary stream.
 QValue create(long value)
          Create a new QValue with type PropertyType.LONG.
 QValue create(Name value)
          Create a new QValue with type PropertyType.NAME.
 QValue create(Path value)
          Create a new QValue with type PropertyType.PATH.
 QValue create(String value, int type)
          Create a new QValue using the given String representation of the value and its type.
 QValue create(URI value)
          Create a new QValue with type PropertyType.URI.
 

Method Detail

create

QValue create(String value,
              int type)
              throws ValueFormatException,
                     RepositoryException
Create a new QValue using the given String representation of the value and its type.

Parameters:
value - String representation of the new QValue. Note, that the given String must never be null.
type - A valid type.
Returns:
a new QValue.
Throws:
ValueFormatException - If the given value cannot be converted to the specified type.
RepositoryException - If another error occurs.
See Also:
QValue.getType()

create

QValue create(Calendar value)
              throws RepositoryException
Create a new QValue with type PropertyType.DATE.

Parameters:
value - A non-null Calendar object acting as value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(double value)
              throws RepositoryException
Create a new QValue with type PropertyType.DOUBLE.

Parameters:
value - A double containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(long value)
              throws RepositoryException
Create a new QValue with type PropertyType.LONG.

Parameters:
value - A long containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(boolean value)
              throws RepositoryException
Create a new QValue with type PropertyType.BOOLEAN.

Parameters:
value - A boolean containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(Name value)
              throws RepositoryException
Create a new QValue with type PropertyType.NAME.

Parameters:
value - A non-null Name.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(Path value)
              throws RepositoryException
Create a new QValue with type PropertyType.PATH.

Parameters:
value - A non-null Path.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(BigDecimal value)
              throws RepositoryException
Create a new QValue with type PropertyType.DECIMAL.

Parameters:
value - A non-null BigDecimal.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(URI value)
              throws RepositoryException
Create a new QValue with type PropertyType.URI.

Parameters:
value - A non-null URI.
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(byte[] value)
              throws RepositoryException
Create a new QValue with type PropertyType.BINARY.

Parameters:
value -
Returns:
a new QValue.
Throws:
RepositoryException

create

QValue create(InputStream value)
              throws RepositoryException,
                     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 be PropertyType.BINARY.

Parameters:
value - binary stream
Returns:
a new binary QValue.
Throws:
RepositoryException - if the value could not be created
IOException - if the stream can not be consumed

create

QValue create(File value)
              throws RepositoryException,
                     IOException
Create a new QValue with type PropertyType.BINARY.

Parameters:
value -
Returns:
a new binary QValue.
Throws:
IOException
RepositoryException

computeAutoValues

QValue[] computeAutoValues(QPropertyDefinition propertyDefinition)
                           throws RepositoryException
Given the QPropertyDefinition 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


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.