org.apache.jackrabbit.core.value
Class InternalValueFactory

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
      extended by org.apache.jackrabbit.core.value.InternalValueFactory
All Implemented Interfaces:
QValueFactory

public final class InternalValueFactory
extends AbstractQValueFactory

InternalValueFactory implements a QValueFactory that creates InternalValue instances for binary values.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
DEFAULT_ENCODING, NAME_FACTORY, PATH_FACTORY
 
Method Summary
 QValue create(BigDecimal value)
          Create a new QValue with type PropertyType.DECIMAL.
 QValue create(boolean value)
          Create a new QValue with type PropertyType.BOOLEAN.
 QValue create(byte[] value)
          Create a new QValue with type PropertyType.BINARY.
 QValue create(Calendar value)
          Create a new QValue with type PropertyType.DATE.
 QValue create(double value)
          Create a new QValue with type PropertyType.DOUBLE.
 QValue create(File value)
          Create a new QValue with type PropertyType.BINARY.
 QValue create(InputStream value)
          Creates a QValue that contains the given binary stream.
 QValue create(long value)
          Create a new QValue with type PropertyType.LONG.
 QValue create(Name value)
          Create a new QValue with type PropertyType.NAME.
 QValue create(Path value)
          Create a new QValue with type PropertyType.PATH.
 QValue create(URI value)
          Create a new QValue with type PropertyType.URI.
protected  QValue createReference(String ref, boolean weak)
          Creates a new QValue of type REFERENCE or WEAKREFERENCE.
protected  QValue createString(String value)
          Creates a new QValue of type STRING.
static QValueFactory getInstance()
           
 
Methods inherited from class org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
computeAutoValues, create
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static QValueFactory getInstance()

create

public QValue create(Calendar value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.DATE.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A non-null Calendar object acting as value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(Calendar)

create

public QValue create(double value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.DOUBLE.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A double containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(double)

create

public QValue create(long value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.LONG.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A long containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(long)

create

public QValue create(boolean value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.BOOLEAN.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A boolean containing the value of the new QValue.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(boolean)

create

public QValue create(Name value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.NAME.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A non-null Name.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(Name)

create

public QValue create(Path value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.PATH.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A non-null Path.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(Path)

create

public QValue create(URI value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.URI.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A non-null URI.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(URI)

create

public QValue create(BigDecimal value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.DECIMAL.

Specified by:
create in interface QValueFactory
Overrides:
create in class AbstractQValueFactory
Parameters:
value - A non-null BigDecimal.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(URI)

create

public QValue create(byte[] value)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.BINARY.

Returns:
a new QValue.
Throws:
RepositoryException

create

public QValue create(InputStream value)
              throws RepositoryException,
                     IOException
Description copied from interface: QValueFactory
Creates a QValue that contains the given binary stream. The given stream is consumed and closed by this method. The type of the resulting QValue will be PropertyType.BINARY.

Parameters:
value - binary stream
Returns:
a new binary QValue.
Throws:
RepositoryException - if the value could not be created
IOException - if the stream can not be consumed

create

public QValue create(File value)
              throws RepositoryException,
                     IOException
Description copied from interface: QValueFactory
Create a new QValue with type PropertyType.BINARY.

Returns:
a new binary QValue.
Throws:
IOException
RepositoryException

createReference

protected QValue createReference(String ref,
                                 boolean weak)
Description copied from class: AbstractQValueFactory
Creates a new QValue of type REFERENCE or WEAKREFERENCE.

Overrides:
createReference in class AbstractQValueFactory
Parameters:
ref - the reference value.
weak - whether the reference is weak.
Returns:
a new QValue.

createString

protected QValue createString(String value)
Description copied from class: AbstractQValueFactory
Creates a new QValue of type STRING.

Overrides:
createString in class AbstractQValueFactory
Parameters:
value - the string value.
Returns:
a new QValue.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.