org.apache.jackrabbit.spi.commons.value
Class AbstractQValueFactory

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory
All Implemented Interfaces:
QValueFactory
Direct Known Subclasses:
InternalValueFactory, QValueFactoryImpl

public abstract class AbstractQValueFactory
extends Object
implements QValueFactory

AbstractQValueFactory...


Field Summary
static String DEFAULT_ENCODING
          the default encoding
protected static NameFactory NAME_FACTORY
           
protected static PathFactory PATH_FACTORY
           
 
Constructor Summary
AbstractQValueFactory()
           
 
Method Summary
 QValue[] computeAutoValues(QPropertyDefinition propertyDefinition)
          Given the QPropertyDefinition of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.
 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(Calendar value)
          Create a new QValue with type PropertyType.DATE.
 QValue create(double value)
          Create a new QValue with type PropertyType.DOUBLE.
 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(String value, int type)
          Create a new QValue using the given String representation of the value and its type.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.spi.QValueFactory
create, create, create
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
the default encoding

See Also:
Constant Field Values

PATH_FACTORY

protected static final PathFactory PATH_FACTORY

NAME_FACTORY

protected static final NameFactory NAME_FACTORY
Constructor Detail

AbstractQValueFactory

public AbstractQValueFactory()
Method Detail

computeAutoValues

public QValue[] computeAutoValues(QPropertyDefinition propertyDefinition)
                           throws RepositoryException
Description copied from interface: QValueFactory
Given the QPropertyDefinition of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.

Specified by:
computeAutoValues in interface QValueFactory
Parameters:
propertyDefinition - definition of property for which values should be created
Returns:
computed value
Throws:
RepositoryException
See Also:
QValueFactory.computeAutoValues(org.apache.jackrabbit.spi.QPropertyDefinition)

create

public QValue create(String value,
                     int type)
              throws RepositoryException
Description copied from interface: QValueFactory
Create a new QValue using the given String representation of the value and its type.

Specified by:
create in interface QValueFactory
Parameters:
value - String representation of the new QValue. Note, that the given String must never be null.
type - A valid type.
Returns:
a new QValue.
Throws:
ValueFormatException - If the given value cannot be converted to the specified type.
RepositoryException - If another error occurs.
See Also:
QValueFactory.create(String, int)

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
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
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
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
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
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
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
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
Parameters:
value - A non-null BigDecimal.
Returns:
a new QValue.
Throws:
RepositoryException
See Also:
QValueFactory.create(URI)

createString

protected QValue createString(String value)
Creates a new QValue of type STRING.

Parameters:
value - the string value.
Returns:
a new QValue.

createReference

protected QValue createReference(String ref,
                                 boolean weak)
Creates a new QValue of type REFERENCE or WEAKREFERENCE.

Parameters:
ref - the reference value.
weak - whether the reference is weak.
Returns:
a new QValue.


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