Class 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
    PropertyTypeInternal Format
    STRINGString
    LONGLong
    DOUBLEDouble
    DATECalendar
    BOOLEANBoolean
    NAMEName
    PATHPath
    URIURI
    DECIMALBigDecimal
    BINARYBLOBFileValue
    REFERENCENodeId
    See Also:
    Serialized Form
    • Field Detail

    • Method Detail

      • 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 value
        resolver -
        store - the data store
        Returns:
        the created internal value
        Throws:
        RepositoryException
        ValueFormatException
      • 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​(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
      • 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 stream
        store -
        Returns:
        the internal value
        Throws:
        RepositoryException
      • 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 store
        id - 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()
      • 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:
        AbstractQValue.toString()
      • isInDataStore

        public boolean isInDataStore()
      • getLength

        public long getLength()
                       throws RepositoryException
        Specified by:
        getLength in interface org.apache.jackrabbit.spi.QValue
        Overrides:
        getLength in class org.apache.jackrabbit.spi.commons.value.AbstractQValue
        Throws:
        RepositoryException
        See Also:
        QValue.getLength()
      • getBinary

        public Binary getBinary()
                         throws RepositoryException
        Specified by:
        getBinary in interface org.apache.jackrabbit.spi.QValue
        Overrides:
        getBinary in class org.apache.jackrabbit.spi.commons.value.AbstractQValue
        Throws:
        RepositoryException
        See Also:
        QValue.getBinary()
      • discard

        public void discard()
        Specified by:
        discard in interface org.apache.jackrabbit.spi.QValue
        Overrides:
        discard in class org.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 class org.apache.jackrabbit.spi.commons.value.AbstractQValue