Package org.apache.jackrabbit.value
Class AbstractValueFactory
- java.lang.Object
-
- org.apache.jackrabbit.value.AbstractValueFactory
-
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
SimpleValueFactory,ValueFactoryImpl
public abstract class AbstractValueFactory extends java.lang.Object implements ValueFactory
This class implements theValueFactoryinterface.- See Also:
Session.getValueFactory()
-
-
Method Summary
All Methods Instance Methods Concrete 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)Returns aValueobject ofPropertyType.BINARYwith a value consisting of the content of the specifiedInputStream.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 node, boolean weak)Returns aValueobject ofPropertyType.REFERENCE(ifweakisfalse) orPropertyType.REFERENCE(ifweakistrue) that holds the identifier of the specifiedNode.
-
-
-
Method Detail
-
createValue
public Value createValue(boolean value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aboolean- Returns:
- a
ValueofPropertyType.BOOLEAN
-
createValue
public Value createValue(java.util.Calendar value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aCalendar- Returns:
- a
ValueofPropertyType.DATE
-
createValue
public Value createValue(double value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DOUBLE
-
createValue
public Value createValue(java.io.InputStream value)
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
public Value createValue(long value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- along- Returns:
- a
ValueofPropertyType.LONG
-
createValue
public 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.- 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
public Value createValue(java.lang.String value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- aString- Returns:
- a
ValueofPropertyType.STRING
-
createValue
public Value createValue(java.lang.String value, int type) throws ValueFormatException
- 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
public 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.- Specified by:
createBinaryin interfaceValueFactory- Parameters:
stream- anInputStream- Returns:
- a
Binary - Throws:
RepositoryException- if an error occurs.
-
createValue
public Value createValue(Binary value)
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
public Value createValue(java.math.BigDecimal value)
- Specified by:
createValuein interfaceValueFactory- Parameters:
value- adouble- Returns:
- a
ValueofPropertyType.DECIMAL
-
createValue
public Value createValue(Node node, 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.- 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.
-
-