org.priha.core.values
Class ValueFactoryImpl

java.lang.Object
  extended by org.priha.core.values.ValueFactoryImpl

public class ValueFactoryImpl
extends java.lang.Object

This is a session-specific holder of things.


Constructor Summary
ValueFactoryImpl(SessionImpl session)
           
 
Method Summary
 Value[] addValue(Value[] orig, Value add)
          Returns a new Value array with the new Value added in the last position.
static boolean canConvert(ValueImpl value, int type)
          Returns true, if the given String value can be converted to the given type.
 ValueImpl cloneValue(ValueImpl value)
           
 Value[] cloneValues(Value[] values)
          Clones a value array.
 ValueImpl createValue(boolean value)
           
 ValueImpl createValue(boolean value, int type)
           
 ValueImpl createValue(java.util.Calendar value)
           
 ValueImpl createValue(double value)
           
 ValueImpl createValue(java.io.InputStream value)
           
 ValueImpl createValue(java.io.InputStream value, int type)
           
 ValueImpl createValue(long value)
           
 ValueImpl createValue(Node value)
           
 ValueImpl createValue(QName qn, int type)
           
 ValueImpl createValue(java.lang.String value)
           
 ValueImpl createValue(java.lang.String value, int type)
           
 ValueImpl createValue(ValueImpl value)
           
 Value[] removeValue(Value[] orig, Value rem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactoryImpl

public ValueFactoryImpl(SessionImpl session)
Method Detail

createValue

public ValueImpl createValue(ValueImpl value)
                      throws ValueFormatException,
                             java.lang.IllegalStateException,
                             RepositoryException
Throws:
ValueFormatException
java.lang.IllegalStateException
RepositoryException

createValue

public ValueImpl createValue(java.lang.String value)

createValue

public ValueImpl createValue(long value)

createValue

public ValueImpl createValue(double value)

createValue

public ValueImpl createValue(boolean value)

createValue

public ValueImpl createValue(java.util.Calendar value)

createValue

public ValueImpl createValue(java.io.InputStream value)

createValue

public ValueImpl createValue(Node value)
                      throws RepositoryException
Throws:
RepositoryException

createValue

public ValueImpl createValue(boolean value,
                             int type)
                      throws ValueFormatException
Throws:
ValueFormatException

createValue

public ValueImpl createValue(java.io.InputStream value,
                             int type)
                      throws ValueFormatException
Throws:
ValueFormatException

canConvert

public static boolean canConvert(ValueImpl value,
                                 int type)
Returns true, if the given String value can be converted to the given type.

Parameters:
value -
type -
Returns:

createValue

public ValueImpl createValue(java.lang.String value,
                             int type)
                      throws ValueFormatException
Throws:
ValueFormatException

cloneValues

public Value[] cloneValues(Value[] values)
                    throws ValueFormatException,
                           java.lang.IllegalStateException,
                           RepositoryException
Clones a value array. This creates a new instance of every single value contained in this array, a so-called deep clone.

Parameters:
values - The array to clone.
Returns:
A deep clone of the array.
Throws:
ValueFormatException
java.lang.IllegalStateException
RepositoryException

cloneValue

public ValueImpl cloneValue(ValueImpl value)
                     throws ValueFormatException,
                            java.lang.IllegalStateException,
                            RepositoryException
Throws:
ValueFormatException
java.lang.IllegalStateException
RepositoryException

addValue

public Value[] addValue(Value[] orig,
                        Value add)
Returns a new Value array with the new Value added in the last position.

Parameters:
orig - Original Value array
add - The value to be added.
Returns:
A new Array with the add value in the last position.

createValue

public ValueImpl createValue(QName qn,
                             int type)
                      throws ValueFormatException
Throws:
ValueFormatException

removeValue

public Value[] removeValue(Value[] orig,
                           Value rem)