Package javax.jcr
Interface ValueFactory
-
- All Known Subinterfaces:
JackrabbitValueFactory
- All Known Implementing Classes:
AbstractValueFactory,SimpleValueFactory,ValueFactoryImpl,ValueFactoryImpl,ValueFactoryQImpl
public interface ValueFactoryTheValueFactoryobject provides methods for the creation Value objects that can then be used to set properties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description BinarycreateBinary(java.io.InputStream stream)Returns aBinaryobject with a value consisting of the content of the specifiedInputStream.ValuecreateValue(boolean value)ValuecreateValue(double value)ValuecreateValue(long value)ValuecreateValue(java.io.InputStream value)Deprecated.As of JCR 2.0,createValue(Binary)should be used instead.ValuecreateValue(java.lang.String value)ValuecreateValue(java.lang.String value, int type)ValuecreateValue(java.math.BigDecimal value)ValuecreateValue(java.util.Calendar value)ValuecreateValue(Binary value)Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedBinary.ValuecreateValue(Node value)ValuecreateValue(Node value, boolean weak)Returns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode.
-
-
-
Method Detail
-
createValue
Value createValue(java.lang.String value)
- Parameters:
value- aString- Returns:
- a
ValueofPropertyType.STRING
-
createValue
Value createValue(java.lang.String value, int type) throws ValueFormatException
- Parameters:
value- aStringtype- one of the constants defined inPropertyType.- Returns:
- a
ValueofPropertyTypetype. - Throws:
ValueFormatException- if the specifiedvaluecannot be converted to the specifiedtype.
-
createValue
Value createValue(long value)
- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
createValue
Value createValue(double value)
- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
createValue
Value createValue(java.math.BigDecimal value)
- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL - Since:
- JCR 2.0
-
createValue
Value createValue(boolean value)
- Parameters:
value- aboolean- Returns:
- a
ValueofPropertyType.BOOLEAN
-
createValue
Value createValue(java.util.Calendar value)
- Parameters:
value- aCalendar- Returns:
- a
ValueofPropertyType.DATE - Throws:
java.lang.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
Value createValue(java.io.InputStream value)
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
Value createValue(Binary value)
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
Value createValue(Node value) throws RepositoryException
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
Value createValue(Node value, boolean weak) throws RepositoryException
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
Binary createBinary(java.io.InputStream stream) throws RepositoryException
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
-
-