Package org.apache.jackrabbit.value
Class AbstractValueFactory
java.lang.Object
org.apache.jackrabbit.value.AbstractValueFactory
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
SimpleValueFactory,ValueFactoryImpl
This class implements the
ValueFactory interface.- See Also:
-
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 node, boolean weak) Returns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode.
-
Method Details
-
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
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
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
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
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- aString- Returns:
- a
ValueofPropertyType.STRING
-
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
Returns 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
Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aBinary- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL
-
createValue
Returns 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:
node- 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.
-