Package org.apache.jackrabbit.core.value
Class InternalValue
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.value.AbstractQValue
-
- org.apache.jackrabbit.core.value.InternalValue
-
- All Implemented Interfaces:
Serializable
,org.apache.jackrabbit.spi.QValue
public class InternalValue extends org.apache.jackrabbit.spi.commons.value.AbstractQValue
InternalValue
represents the internal format of a property value.The following table specifies the internal format for every property type:
Internal format of property types PropertyType Internal Format STRING String LONG Long DOUBLE Double DATE Calendar BOOLEAN Boolean NAME Name PATH Path URI URI DECIMAL BigDecimal BINARY BLOBFileValue REFERENCE NodeId
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static InternalValue[]
EMPTY_ARRAY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InternalValue
create(boolean value)
static InternalValue
create(byte[] value)
static InternalValue
create(double value)
static InternalValue
create(long value)
static InternalValue
create(InputStream value)
static InternalValue
create(InputStream value, org.apache.jackrabbit.core.data.DataStore store)
Create an internal value that is stored in the data store (if enabled).static InternalValue
create(String value)
static InternalValue
create(BigDecimal value)
static InternalValue
create(URI value)
static InternalValue
create(Calendar value)
static InternalValue
create(Value value, org.apache.jackrabbit.spi.commons.conversion.NamePathResolver resolver)
Create a new internal value from the given JCR value.static InternalValue
create(Value value, org.apache.jackrabbit.spi.commons.conversion.NamePathResolver resolver, org.apache.jackrabbit.core.data.DataStore store)
Create a new internal value from the given JCR value.static InternalValue
create(org.apache.jackrabbit.core.data.DataStore store, String id)
Create a binary object with the given identifier.static InternalValue
create(org.apache.jackrabbit.core.fs.FileSystemResource value)
static InternalValue
create(NodeId value)
static InternalValue
create(NodeId value, boolean weak)
static InternalValue
create(org.apache.jackrabbit.spi.Name value)
static InternalValue[]
create(org.apache.jackrabbit.spi.Name[] values)
static InternalValue
create(org.apache.jackrabbit.spi.Path value)
static InternalValue
create(org.apache.jackrabbit.spi.QValue value)
static InternalValue[]
create(org.apache.jackrabbit.spi.QValue[] values)
InternalValue
createCopy()
Create a copy of this object.static InternalValue
createDate(String value)
https://issues.apache.org/jira/browse/JCR-3083static InternalValue
createTemporary(InputStream value)
Create an internal value that is backed by a temporary file.void
deleteBinaryResource()
Delete persistent binary objects.void
discard()
boolean
equals(Object object)
Binary
getBinary()
Calendar
getDate()
long
getLength()
NodeId
getNodeId()
InputStream
getStream()
boolean
isInDataStore()
static InternalValue
valueOf(String s, int type)
Parses the given string as anInternalValue
of the specified type.
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final InternalValue[] EMPTY_ARRAY
-
-
Method Detail
-
create
public static InternalValue create(Value value, org.apache.jackrabbit.spi.commons.conversion.NamePathResolver resolver) throws ValueFormatException, RepositoryException
Create a new internal value from the given JCR value. Large binary values are stored in a temporary file.- Parameters:
value
- the JCR valueresolver
-- Returns:
- the created internal value
- Throws:
RepositoryException
ValueFormatException
-
create
public static InternalValue create(Value value, org.apache.jackrabbit.spi.commons.conversion.NamePathResolver resolver, org.apache.jackrabbit.core.data.DataStore store) throws ValueFormatException, RepositoryException
Create a new internal value from the given JCR value. If the data store is enabled, large binary values are stored in the data store.- Parameters:
value
- the JCR valueresolver
-store
- the data store- Returns:
- the created internal value
- Throws:
RepositoryException
ValueFormatException
-
create
public static InternalValue create(org.apache.jackrabbit.spi.QValue value) throws RepositoryException
- Throws:
RepositoryException
-
create
public static InternalValue[] create(org.apache.jackrabbit.spi.QValue[] values) throws RepositoryException
- Throws:
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
-
createDate
public static InternalValue createDate(String value)
https://issues.apache.org/jira/browse/JCR-3083- Parameters:
value
-- Returns:
- the created value
-
create
public static InternalValue create(BigDecimal value)
- Parameters:
value
-- Returns:
- the created value
-
create
public static InternalValue create(URI 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
-
createTemporary
public static InternalValue createTemporary(InputStream value) throws RepositoryException
Create an internal value that is backed by a temporary file.- Parameters:
value
- the stream- Returns:
- the internal value
- Throws:
RepositoryException
-
create
public static InternalValue create(InputStream value, org.apache.jackrabbit.core.data.DataStore store) throws RepositoryException
Create an internal value that is stored in the data store (if enabled).- Parameters:
value
- the input streamstore
-- Returns:
- the internal value
- Throws:
RepositoryException
-
create
public static InternalValue create(InputStream value) throws RepositoryException
- Parameters:
value
-- Returns:
- Throws:
RepositoryException
-
create
public static InternalValue create(org.apache.jackrabbit.core.fs.FileSystemResource value) throws IOException
- Parameters:
value
-- Returns:
- Throws:
IOException
-
create
public static InternalValue create(org.apache.jackrabbit.core.data.DataStore store, String id)
Create a binary object with the given identifier.- Parameters:
store
- the data storeid
- the identifier- Returns:
- the value
-
create
public static InternalValue create(org.apache.jackrabbit.spi.Name value)
- Parameters:
value
-- Returns:
- the created value
-
create
public static InternalValue[] create(org.apache.jackrabbit.spi.Name[] values)
- Parameters:
values
-- Returns:
- the created value
-
create
public static InternalValue create(org.apache.jackrabbit.spi.Path value)
- Parameters:
value
-- Returns:
- the created value
-
create
public static InternalValue create(NodeId value)
- Parameters:
value
-- Returns:
- the created value
-
create
public static InternalValue create(NodeId value, boolean weak)
- Parameters:
value
-weak
-- Returns:
- the created value
-
getNodeId
public NodeId getNodeId()
-
getDate
public Calendar getDate() throws RepositoryException
- Throws:
RepositoryException
-
createCopy
public InternalValue createCopy() throws RepositoryException
Create a copy of this object. Immutable values will return itself, while mutable values will return a copy.- Returns:
- itself or a copy
- Throws:
RepositoryException
-
valueOf
public static InternalValue valueOf(String s, int type)
Parses the given string as anInternalValue
of the specified type. The string must be in the format returned by theInternalValue.toString()
method.- Parameters:
s
- aString
containing theInternalValue
representation to be parsed.type
-- Returns:
- the
InternalValue
represented by the arguments - Throws:
IllegalArgumentException
- if the specified string can not be parsed as anInternalValue
of the specified type.- See Also:
AbstractQValue.toString()
-
isInDataStore
public boolean isInDataStore()
-
getLength
public long getLength() throws RepositoryException
- Specified by:
getLength
in interfaceorg.apache.jackrabbit.spi.QValue
- Overrides:
getLength
in classorg.apache.jackrabbit.spi.commons.value.AbstractQValue
- Throws:
RepositoryException
- See Also:
QValue.getLength()
-
getStream
public InputStream getStream() throws RepositoryException
- Throws:
RepositoryException
- See Also:
QValue.getStream()
-
getBinary
public Binary getBinary() throws RepositoryException
- Specified by:
getBinary
in interfaceorg.apache.jackrabbit.spi.QValue
- Overrides:
getBinary
in classorg.apache.jackrabbit.spi.commons.value.AbstractQValue
- Throws:
RepositoryException
- See Also:
QValue.getBinary()
-
discard
public void discard()
- Specified by:
discard
in interfaceorg.apache.jackrabbit.spi.QValue
- Overrides:
discard
in classorg.apache.jackrabbit.spi.commons.value.AbstractQValue
- See Also:
QValue.discard()
-
deleteBinaryResource
public void deleteBinaryResource()
Delete persistent binary objects. This method does not delete objects in the data store.
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classorg.apache.jackrabbit.spi.commons.value.AbstractQValue
-
-