Package javax.jcr
Interface ValueFactory
- All Known Subinterfaces:
JackrabbitValueFactory
- All Known Implementing Classes:
AbstractValueFactory,SimpleValueFactory,ValueFactoryImpl,ValueFactoryImpl,ValueFactoryQImpl
public interface ValueFactory
The
ValueFactory object provides methods for the creation Value
objects that can then be used to set properties.-
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) Deprecated.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.
-
Method Details
-
createValue
- Parameters:
value- aString- Returns:
- a
ValueofPropertyType.STRING
-
createValue
- Parameters:
value- aStringtype- one of the constants defined inPropertyType.- Returns:
- a
ValueofPropertyTypetype. - Throws:
ValueFormatException- if the specifiedvaluecannot be converted to the specifiedtype.
-
createValue
- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
createValue
- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
createValue
- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL - Since:
- JCR 2.0
-
createValue
- Parameters:
value- aboolean- Returns:
- a
ValueofPropertyType.BOOLEAN
-
createValue
- Parameters:
value- aCalendar- Returns:
- a
ValueofPropertyType.DATE - Throws:
IllegalArgumentException- if the specifiedvaluecannot be expressed in the ISO 8601-based format defined in the JCR 2.0 specification and the implementation does not support dates incompatible with that format.
-
createValue
Deprecated.As of JCR 2.0,createValue(Binary)should be used instead.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.- Parameters:
value- anInputStream- Returns:
- a
ValueofPropertyType.BINARY
-
createValue
Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.- Parameters:
value- aBinary- Returns:
- a
ValueofPropertyType.BINARY - Since:
- JCR 2.0
-
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.- Parameters:
value- aNode- Returns:
- a
ValueofPropertyType.REFERENCE - Throws:
RepositoryException- if the specifiedNodeis not referenceable, the currentSessionis no longer active, or another error occurs.
-
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.- 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.
-
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.- Parameters:
stream- anInputStream- Returns:
- a
Binary - Throws:
RepositoryException- if an error occurs.- Since:
- JCR 2.0
-
createValue(Binary)should be used instead.