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 theValueFactory
interface.- See Also:
Session.getValueFactory()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Binary
createBinary(java.io.InputStream stream)
Returns aBinary
object with a value consisting of the content of the specifiedInputStream
.Value
createValue(boolean value)
Value
createValue(double value)
Value
createValue(long value)
Value
createValue(java.io.InputStream value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedInputStream
.Value
createValue(java.lang.String value)
Value
createValue(java.lang.String value, int type)
Value
createValue(java.math.BigDecimal value)
Value
createValue(java.util.Calendar value)
Value
createValue(Binary value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.Value
createValue(Node value)
Value
createValue(Node node, boolean weak)
Returns aValue
object ofPropertyType.REFERENCE
(ifweak
isfalse
) orPropertyType.REFERENCE
(ifweak
istrue
) that holds the identifier of the specifiedNode
.
-
-
-
Method Detail
-
createValue
public Value createValue(boolean value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aboolean
- Returns:
- a
Value
ofPropertyType.BOOLEAN
-
createValue
public Value createValue(java.util.Calendar value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aCalendar
- Returns:
- a
Value
ofPropertyType.DATE
-
createValue
public Value createValue(double value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DOUBLE
-
createValue
public Value createValue(java.io.InputStream value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedInputStream
.The passed
InputStream
is closed before this method returns either normally or because of an exception.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- anInputStream
- Returns:
- a
Value
ofPropertyType.BINARY
-
createValue
public Value createValue(long value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- along
- Returns:
- a
Value
ofPropertyType.LONG
-
createValue
public Value createValue(Node value) throws RepositoryException
Returns aValue
object ofPropertyType.REFERENCE
that holds the identifier of the specifiedNode
. ThisValue
object can then be used to set a property that will be a reference to thatNode
.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aNode
- Returns:
- a
Value
ofPropertyType.REFERENCE
- Throws:
RepositoryException
- if the specifiedNode
is not referenceable, the currentSession
is no longer active, or another error occurs.
-
createValue
public Value createValue(java.lang.String value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aString
- Returns:
- a
Value
ofPropertyType.STRING
-
createValue
public Value createValue(java.lang.String value, int type) throws ValueFormatException
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aString
type
- one of the constants defined inPropertyType
.- Returns:
- a
Value
ofPropertyType
type
. - Throws:
ValueFormatException
- if the specifiedvalue
cannot be converted to the specifiedtype
.
-
createBinary
public Binary createBinary(java.io.InputStream stream) throws RepositoryException
Returns aBinary
object with a value consisting of the content of the specifiedInputStream
.The passed
InputStream
is closed before this method returns either normally or because of an exception.- Specified by:
createBinary
in interfaceValueFactory
- Parameters:
stream
- anInputStream
- Returns:
- a
Binary
- Throws:
RepositoryException
- if an error occurs.
-
createValue
public Value createValue(Binary value)
Returns aValue
object ofPropertyType.BINARY
with a value consisting of the content of the specifiedBinary
.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- aBinary
- Returns:
- a
Value
ofPropertyType.BINARY
-
createValue
public Value createValue(java.math.BigDecimal value)
- Specified by:
createValue
in interfaceValueFactory
- Parameters:
value
- adouble
- Returns:
- a
Value
ofPropertyType.DECIMAL
-
createValue
public Value createValue(Node node, boolean weak) throws RepositoryException
Returns aValue
object ofPropertyType.REFERENCE
(ifweak
isfalse
) orPropertyType.REFERENCE
(ifweak
istrue
) that holds the identifier of the specifiedNode
. ThisValue
object can then be used to set a property that will be a reference to thatNode
.- Specified by:
createValue
in interfaceValueFactory
- Parameters:
node
- aNode
weak
- aboolean
. If true then aPropertyType.WEAKREFERENCE
is created, otherwise aPropertyType.REFERENCE
is created.- Returns:
- a
Value
ofPropertyType.REFERENCE
orPropertyType.REFERENCE
- Throws:
RepositoryException
- if the specifiedNode
is not referenceable, the currentSession
is no longer active, or another error occurs.
-
-