org.apache.jackrabbit.core.value
Class InternalValue

java.lang.Object
  extended by org.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(InputStream value, boolean temp)
           
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(UUID value)
           
static InternalValue create(Value value, NamespaceResolver nsResolver)
           
 InternalValue createCopy()
           
 boolean equals(Object obj)
          
 int getType()
           
 int hashCode()
          
 Object internalValue()
           
 Value toJCRValue(NamespaceResolver nsResolver)
           
 String toString()
          Returns the string representation of this internal value.
static InternalValue valueOf(String s, int type)
          Parses the given string as an InternalValue of the specified 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(String value)
Parameters:
value -
Returns:
the created value

create

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

create

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

create

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

create

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

create

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

create

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

create

public static InternalValue create(InputStream value,
                                   boolean temp)
                            throws IOException
Parameters:
value -
temp -
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:
the created value

create

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

create

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

create

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

create

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

create

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

toJCRValue

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

internalValue

public Object internalValue()
Returns:
the internal object

getType

public int getType()
Returns:
the type

createCopy

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

valueOf

public static InternalValue valueOf(String s,
                                    int type)
Parses the given string as an InternalValue of the specified type. The string must be in the format returned by the InternalValue.toString() method.

Parameters:
s - a String containing the InternalValue representation to be parsed.
type -
Returns:
the InternalValue represented by the arguments
Throws:
IllegalArgumentException - if the specified string can not be parsed as an InternalValue of the specified type.
See Also:
toString()

toString

public String toString()
Returns the string representation of this internal value.

Overrides:
toString in class Object
Returns:
string representation of this internal value

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


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