org.apache.jackrabbit.core.value
Class InternalValue

java.lang.Object
  extended byorg.apache.jackrabbit.core.value.InternalValue

public class InternalValue
extends Object

InternalValue represents the internal format of a property value.

The following table specifies the internal format for every property type:

 PropertyTypeSTRINGLONGDOUBLEDATEBOOLEANNAMEPATHBINARYREFERENCE
Internal Format
String
Long
Double
Calendar
Boolean
QName
Path
BLOBFileValue
UUID


Field Summary
static InternalValue BOOLEAN_FALSE
           
static InternalValue BOOLEAN_TRUE
           
static InternalValue[] EMPTY_ARRAY
           
 
Method Summary
static InternalValue create(boolean value)
           
static InternalValue create(byte[] value)
           
static InternalValue create(Calendar value)
           
static InternalValue[] create(Calendar[] values)
           
static InternalValue create(double value)
           
static InternalValue create(File value)
           
static InternalValue create(FileSystemResource value)
           
static InternalValue create(InputStream value)
           
static InternalValue create(long value)
           
static InternalValue create(Path value)
           
static InternalValue create(QName value)
           
static InternalValue[] create(QName[] values)
           
static InternalValue create(String value)
           
static InternalValue[] create(String[] values)
           
static InternalValue create(String value, int targetType, NamespaceResolver nsResolver)
           
static InternalValue create(UUID value)
           
static InternalValue create(Value value, int targetType, NamespaceResolver nsResolver)
           
static InternalValue create(Value value, NamespaceResolver nsResolver)
           
 InternalValue createCopy()
           
 boolean equals(Object obj)
           
 int getType()
           
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 Object internalValue()
           
 Value toJCRValue(NamespaceResolver nsResolver)
           
 String toString()
          Returns the string representation of this internal value.
static InternalValue valueOf(String s, int type)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final InternalValue[] EMPTY_ARRAY

BOOLEAN_TRUE

public static final InternalValue BOOLEAN_TRUE

BOOLEAN_FALSE

public static final InternalValue BOOLEAN_FALSE
Method Detail

create

public static InternalValue create(Value value,
                                   NamespaceResolver nsResolver)
                            throws ValueFormatException,
                                   RepositoryException
Parameters:
value -
nsResolver -
Returns:
Throws:
ValueFormatException
RepositoryException

create

public static InternalValue create(Value value,
                                   int targetType,
                                   NamespaceResolver nsResolver)
                            throws ValueFormatException,
                                   RepositoryException
Parameters:
value -
targetType -
nsResolver -
Returns:
Throws:
ValueFormatException
RepositoryException

create

public static InternalValue create(String value,
                                   int targetType,
                                   NamespaceResolver nsResolver)
                            throws ValueFormatException,
                                   RepositoryException
Parameters:
value -
targetType -
nsResolver -
Returns:
Throws:
ValueFormatException
RepositoryException

create

public static InternalValue create(String value)
Parameters:
value -
Returns:

create

public static InternalValue create(long value)
Parameters:
value -
Returns:

create

public static InternalValue create(double value)
Parameters:
value -
Returns:

create

public static InternalValue create(Calendar value)
Parameters:
value -
Returns:

create

public static InternalValue create(boolean value)
Parameters:
value -
Returns:

create

public static InternalValue create(byte[] value)
Parameters:
value -
Returns:

create

public static InternalValue create(InputStream value)
                            throws IOException
Parameters:
value -
Returns:
Throws:
IOException

create

public static InternalValue create(FileSystemResource value)
                            throws IOException
Parameters:
value -
Returns:
Throws:
IOException

create

public static InternalValue create(File value)
                            throws IOException
Parameters:
value -
Returns:
Throws:
IOException

create

public static InternalValue create(QName value)
Parameters:
value -
Returns:

create

public static InternalValue[] create(QName[] values)
Parameters:
values -
Returns:

create

public static InternalValue[] create(String[] values)
Parameters:
values -
Returns:

create

public static InternalValue[] create(Calendar[] values)
Parameters:
values -
Returns:

create

public static InternalValue create(Path value)
Parameters:
value -
Returns:

create

public static InternalValue create(UUID value)
Parameters:
value -
Returns:

toJCRValue

public Value toJCRValue(NamespaceResolver nsResolver)
                 throws RepositoryException
Parameters:
nsResolver -
Returns:
Throws:
RepositoryException

internalValue

public Object internalValue()
Returns:

getType

public int getType()
Returns:

createCopy

public InternalValue createCopy()
                         throws RepositoryException
Returns:
Throws:
RepositoryException

toString

public String toString()
Returns the string representation of this internal value. If this is a binary value then the path of its backing file will be returned.

Returns:
string representation of this internal value

equals

public boolean equals(Object obj)

hashCode

public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.

Returns:
always zero
See Also:
Object.hashCode()

valueOf

public static InternalValue valueOf(String s,
                                    int type)
Parameters:
s -
type -
Returns:


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