javax.jcr

## Interface ValueFactory

    public interface ValueFactory

The `ValueFactory` object provides methods for the creation Value objects that can then be used to set properties.

### Method Summary

All Methods Instance Methods Abstract Methods
`Value` `createValue(boolean value)` Returns a `Value` object of `PropertyType.BOOLEAN` with the specified `value`.
`Value` `createValue(java.util.Calendar value)` Returns a `Value` object of `PropertyType.DATE` with the specified `value`.
`Value` `createValue(double value)` Returns a `Value` object of `PropertyType.DOUBLE` with the specified `value`.
`Value` `createValue(java.io.InputStream value)` Returns a `Value` object of `PropertyType.BINARY` with a value consisting of the content of the specified `InputStream`.
`Value` `createValue(long value)` Returns a `Value` object of `PropertyType.LONG` with the specified `value`.
`Value` `createValue(Node value)` Returns a `Value` object of `PropertyType.REFERENCE` that holds the UUID of the specified `Node`.
`Value` `createValue(java.lang.String value)` Returns a `Value` object of `PropertyType.STRING` with the specified `value`.
`Value` `createValue(java.lang.String value, int type)` Returns a `Value` object of the `PropertyType` specified by `type` with the specified `value`.

### Method Detail

#### createValue

    Value createValue(java.lang.String value)

Returns a `Value` object of `PropertyType.STRING` with the specified `value`.

Parameters:
  `value` - a `String`
Returns:
  a `Value` of `PropertyType.STRING`

#### createValue

    Value createValue(java.lang.String value,
                      int type)
               throws ValueFormatException

Returns a `Value` object of the `PropertyType` specified by `type` with the specified `value`. A `ValueFormatException` is thrown if the specified `value` cannot be converted to the specifed `type`.

Parameters:
  `value` - a `String`
  `type` - one of the constants defined in `PropertyType`.
Returns:
  a `Value` of `PropertyType` `type`.
Throws:
  `ValueFormatException` - if the specified `value` cannot be converted to the specifed `type`.

#### createValue

    Value createValue(long value)

Returns a `Value` object of `PropertyType.LONG` with the specified `value`.

Parameters:
  `value` - a `long`
Returns:
  a `Value` of `PropertyType.LONG`

#### createValue

    Value createValue(double value)

Returns a `Value` object of `PropertyType.DOUBLE` with the specified `value`.

Parameters:
  `value` - a `double`
Returns:
  a `Value` of `PropertyType.DOUBLE`

#### createValue

    Value createValue(boolean value)

Returns a `Value` object of `PropertyType.BOOLEAN` with the specified `value`.

Parameters:
  `value` - a `boolean`
Returns:
  a `Value` of `PropertyType.BOOLEAN`

#### createValue

    Value createValue(java.util.Calendar value)

Returns a `Value` object of `PropertyType.DATE` with the specified `value`.

Parameters:
  `value` - a `Calendar`
Returns:
  a `Value` of `PropertyType.DATE`

#### createValue

    Value createValue(java.io.InputStream value)

Returns a `Value` object of `PropertyType.BINARY` with a value consisting of the content of the specified `InputStream`.

Parameters:
  `value` - an `InputStream`
Returns:
  a `Value` of `PropertyType.BINARY`

#### createValue

    Value createValue(Node value)
               throws RepositoryException

Returns a `Value` object of `PropertyType.REFERENCE` that holds the UUID of the specified `Node`. This `Value` object can then be used to set a property that will be a reference to that `Node`.

A `RepositoryException` is thrown if the specified `Node` is not referencable, the current `Session` is no longer active, or another error occurs.

Parameters:
  `value` - a `Node`
Returns:
  a `Value` of `PropertyType.REFERENCE`
Throws:
  `RepositoryException` - if the specified `Node` is not referencable, the current `Session` is no longer active, or another error occurs.

Copyright © 2004-2005 Day Software Management AG. All Rights Reserved.