Class AbstractQValueFactory
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
-
- All Implemented Interfaces:
QValueFactory
- Direct Known Subclasses:
InternalValueFactory,QValueFactoryImpl
public abstract class AbstractQValueFactory extends Object implements QValueFactory
AbstractQValueFactory...
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ENCODINGthe default encodingprotected static NameFactoryNAME_FACTORYprotected static PathFactoryPATH_FACTORY
-
Constructor Summary
Constructors Constructor Description AbstractQValueFactory()
-
Method Summary
All Methods Instance Methods Concrete 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(double value)Create a newQValuewith typePropertyType.DOUBLE.QValuecreate(long value)Create a newQValuewith typePropertyType.LONG.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.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.spi.QValueFactory
create, create, create
-
-
-
-
Field Detail
-
DEFAULT_ENCODING
public static final String DEFAULT_ENCODING
the default encoding- See Also:
- Constant Field Values
-
PATH_FACTORY
protected static final PathFactory PATH_FACTORY
-
NAME_FACTORY
protected static final NameFactory NAME_FACTORY
-
-
Method Detail
-
computeAutoValues
public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition) throws RepositoryException
Description copied from interface:QValueFactoryGiven theQPropertyDefinitionof an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.- Specified by:
computeAutoValuesin interfaceQValueFactory- Parameters:
propertyDefinition- definition of property for which values should be created- Returns:
- computed value
- Throws:
RepositoryException- See Also:
QValueFactory.computeAutoValues(org.apache.jackrabbit.spi.QPropertyDefinition)
-
create
public QValue create(String value, int type) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValueusing the given String representation of the value and itstype.- Specified by:
createin 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 givenvaluecannot be converted to the specifiedtype.RepositoryException- If another error occurs.- See Also:
QValueFactory.create(String, int)
-
create
public QValue create(Calendar value) throws RepositoryException
Description copied from interface:QValueFactoryCreate a newQValuewith typePropertyType.DATE.- Specified by:
createin interfaceQValueFactory- 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- 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- 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- 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- 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- 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- 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- Parameters:
value- A non-nullBigDecimal.- Returns:
- a new
QValue. - Throws:
RepositoryException- See Also:
QValueFactory.create(URI)
-
createString
protected QValue createString(String value)
Creates a new QValue of type STRING.- Parameters:
value- the string value.- Returns:
- a new QValue.
-
-