Package org.apache.jackrabbit.core.value
Class InternalValueFactory
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
-
- org.apache.jackrabbit.core.value.InternalValueFactory
-
- All Implemented Interfaces:
QValueFactory
public final class InternalValueFactory extends AbstractQValueFactory
InternalValueFactoryimplements aQValueFactorythat createsInternalValueinstances for binary values.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
DEFAULT_ENCODING, NAME_FACTORY, PATH_FACTORY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(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.protected QValuecreateReference(String ref, boolean weak)Creates a new QValue of type REFERENCE or WEAKREFERENCE.protected QValuecreateString(String value)Creates a new QValue of type STRING.static QValueFactorygetInstance()-
Methods inherited from class org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
computeAutoValues, create
-
-
-
-
Method Detail
-
getInstance
public static QValueFactory getInstance()
-
create
public QValue create(Calendar value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.DATE.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- A non-nullCalendarobject acting as value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(Calendar)
-
create
public QValue create(double value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.DOUBLE.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- Adoublecontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(double)
-
create
public QValue create(long value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.LONG.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- Alongcontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(long)
-
create
public QValue create(boolean value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.BOOLEAN.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- Abooleancontaining the value of the newQValue.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(boolean)
-
create
public QValue create(Name value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.NAME.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- A non-nullName.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(Name)
-
create
public QValue create(Path value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.PATH.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- A non-nullPath.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(Path)
-
create
public QValue create(URI value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.URI.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- A non-nullURI.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(URI)
-
create
public QValue create(BigDecimal value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.DECIMAL.- Specified by:
createin interfaceQValueFactory- Overrides:
createin classAbstractQValueFactory- Parameters:
value- A non-nullBigDecimal.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(URI)
-
create
public QValue create(byte[] value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.BINARY.- Returns:
- a new
QValue. - Throws:
RepositoryException
-
create
public QValue create(InputStream value) throws RepositoryException, IOException
Description copied from interface:QValueFactoryCreates 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
public QValue create(File value) throws RepositoryException, IOException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.BINARY.- Returns:
- a new binary
QValue. - Throws:
IOExceptionRepositoryException
-
createReference
protected QValue createReference(String ref, boolean weak)
Description copied from class:AbstractQValueFactoryCreates a new QValue of type REFERENCE or WEAKREFERENCE.- Overrides:
createReferencein classAbstractQValueFactory- Parameters:
ref- the reference value.weak- whether the reference is weak.- Returns:
- a new QValue.
-
createString
protected QValue createString(String value)
Description copied from class:AbstractQValueFactoryCreates a new QValue of type STRING.- Overrides:
createStringin classAbstractQValueFactory- Parameters:
value- the string value.- Returns:
- a new QValue.
-
-