Package org.apache.jackrabbit.spi
Interface QValueFactory
-
- All Known Implementing Classes:
AbstractQValueFactory,InternalValueFactory,QValueFactoryImpl,QValueFactoryLogger
public interface QValueFactoryQValueFactorydefines methods to createQValueinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QValue[]computeAutoValues(QPropertyDefinition propertyDefinition)Given theQPropertyDefinitionof an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.QValuecreate(boolean value)Create a newQValuewith typePropertyType.BOOLEAN.QValuecreate(byte[] value)Create a newQValuewith typePropertyType.BINARY.QValuecreate(double value)Create a newQValuewith typePropertyType.DOUBLE.QValuecreate(long value)Create a newQValuewith typePropertyType.LONG.QValuecreate(File value)Create a newQValuewith typePropertyType.BINARY.QValuecreate(InputStream value)Creates a QValue that contains the given binary stream.QValuecreate(String value, int type)Create a newQValueusing the given String representation of the value and itstype.QValuecreate(BigDecimal value)Create a newQValuewith typePropertyType.DECIMAL.QValuecreate(URI value)Create a newQValuewith typePropertyType.URI.QValuecreate(Calendar value)Create a newQValuewith typePropertyType.DATE.QValuecreate(Name value)Create a newQValuewith typePropertyType.NAME.QValuecreate(Path value)Create a newQValuewith typePropertyType.PATH.
-
-
-
Method Detail
-
create
QValue create(String value, int type) throws ValueFormatException, RepositoryException
Create a newQValueusing 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 givenvaluecannot be converted to the specifiedtype.RepositoryException- If another error occurs.- See Also:
QValue.getType()
-
create
QValue create(Calendar value) throws RepositoryException
Create a newQValuewith typePropertyType.DATE.- Parameters:
value- A non-nullCalendarobject acting as value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(double value) throws RepositoryException
Create a newQValuewith typePropertyType.DOUBLE.- Parameters:
value- Adoublecontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(long value) throws RepositoryException
Create a newQValuewith typePropertyType.LONG.- Parameters:
value- Alongcontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(boolean value) throws RepositoryException
Create a newQValuewith typePropertyType.BOOLEAN.- Parameters:
value- Abooleancontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(Name value) throws RepositoryException
Create a newQValuewith typePropertyType.NAME.- Parameters:
value- A non-nullName.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(Path value) throws RepositoryException
Create a newQValuewith typePropertyType.PATH.- Parameters:
value- A non-nullPath.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(BigDecimal value) throws RepositoryException
Create a newQValuewith typePropertyType.DECIMAL.- Parameters:
value- A non-nullBigDecimal.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(URI value) throws RepositoryException
Create a newQValuewith typePropertyType.URI.- Parameters:
value- A non-nullURI.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
QValue create(byte[] value) throws RepositoryException
Create a newQValuewith typePropertyType.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 bePropertyType.BINARY.- 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
QValue create(File value) throws RepositoryException, IOException
Create a newQValuewith typePropertyType.BINARY.- Parameters:
value-- Returns:
- a new binary
QValue. - Throws:
IOExceptionRepositoryException
-
computeAutoValues
QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException
Given theQPropertyDefinitionof 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
-
-