Class ValueFactoryQImpl
java.lang.Object
org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl
- All Implemented Interfaces:
ValueFactory
This class implements the
ValueFactory interface,
wrapping an existing SPI QValueFactory and a
NamePathResolver.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValueFactoryQImpl(QValueFactory qfactory, NamePathResolver resolver) Constructs a newValueFactoryQImplbased on an existing SPIQValueFactoryand aNamePathResolver. -
Method Summary
Modifier and TypeMethodDescriptioncreateBinary(InputStream stream) Returns aBinaryobject with a value consisting of the content of the specifiedInputStream.createValue(boolean value) createValue(double value) createValue(long value) createValue(InputStream value) Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedInputStream.createValue(String value) createValue(String value, int type) createValue(BigDecimal value) createValue(Calendar value) createValue(Binary value) Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.createValue(Node value) createValue(Node value, boolean weak) Returns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode.createValue(QValue qvalue) Create a newValuebased on an existingQValueTheQValueFactorythat is wrapped by thisValueFactoryinstance.
-
Constructor Details
-
ValueFactoryQImpl
Constructs a newValueFactoryQImplbased on an existing SPIQValueFactoryand aNamePathResolver.- Parameters:
qfactory- wrappedQValueFactoryresolver- wrappedNamePathResolver
-
-
Method Details
-
getQValueFactory
TheQValueFactorythat is wrapped by thisValueFactoryinstance.- Returns:
- qfactory The
QValueFactorywrapped by this instance.
-
createValue
Create a newValuebased on an existingQValue- Parameters:
qvalue- existingQValue- Returns:
- a
Valuerepresenting theQValue
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aString- Returns:
- a
ValueofPropertyType.STRING
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aboolean- Returns:
- a
ValueofPropertyType.BOOLEAN
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aCalendar- Returns:
- a
ValueofPropertyType.DATE
-
createValue
Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedInputStream.The passed
InputStreamis closed before this method returns either normally or because of an exception.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- anInputStream- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
Returns aValueobject ofPropertyType.REFERENCEthat holds the identifier of the specifiedNode. ThisValueobject can then be used to set a property that will be a reference to thatNode.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aNode- Returns:
- a
ValueofPropertyType.REFERENCE - Throws:
RepositoryException- if the specifiedNodeis not referenceable, the currentSessionis no longer active, or another error occurs.
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aStringtype- one of the constants defined inPropertyType.- Returns:
- a
ValueofPropertyTypetype. - Throws:
ValueFormatException- if the specifiedvaluecannot be converted to the specifiedtype.
-
createBinary
Description copied from interface:ValueFactoryReturns aBinaryobject with a value consisting of the content of the specifiedInputStream.The passed
InputStreamis closed before this method returns either normally or because of an exception.- Specified by:
createBinaryin interfaceValueFactory- Parameters:
stream- anInputStream- Returns:
- a
Binary - Throws:
RepositoryException- if an error occurs.
-
createValue
Description copied from interface:ValueFactoryReturns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aBinary- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
Description copied from interface:ValueFactory- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL
-
createValue
Description copied from interface:ValueFactoryReturns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode. ThisValueobject can then be used to set a property that will be a reference to thatNode.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aNodeweak- aboolean. If true then aPropertyType.WEAKREFERENCEis created, otherwise aPropertyType.REFERENCEis created.- Returns:
- a
ValueofPropertyType.REFERENCEorPropertyType.REFERENCE - Throws:
RepositoryException- if the specifiedNodeis not referenceable, the currentSessionis no longer active, or another error occurs.
-