Class ErrorValue

  • All Implemented Interfaces:
    Value

    public class ErrorValue
    extends java.lang.Object
    implements Value
    Instances of this class represent a Value which couldn't be retrieved. All its accessors throw a RepositoryException.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Binary getBinary()
      Returns a Binary representation of this value.
      boolean getBoolean()
      Returns a Boolean representation of this value.
      java.util.Calendar getDate()
      Returns a Calendar representation of this value.
      java.math.BigDecimal getDecimal()
      Returns a BigDecimal representation of this value.
      double getDouble()
      Returns a double representation of this value.
      long getLong()
      Returns a long representation of this value.
      java.io.InputStream getStream()
      Returns an InputStream representation of this value.
      java.lang.String getString()
      Returns a String representation of this value.
      int getType()
      Returns the type of this Value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ErrorValue

        public ErrorValue​(java.lang.Exception exception,
                          int type)
    • Method Detail

      • getString

        public java.lang.String getString()
                                   throws RepositoryException
        Description copied from interface: Value
        Returns a String representation of this value.
        Specified by:
        getString in interface Value
        Returns:
        A String representation of the value of this property.
        Throws:
        ValueFormatException - if conversion to a String is not possible.
        RepositoryException - if another error occurs.
      • getStream

        public java.io.InputStream getStream()
                                      throws RepositoryException
        Description copied from interface: Value
        Returns an InputStream representation of this value. Uses the standard conversion to binary (see JCR specification).

        It is the responsibility of the caller to close the returned InputStream.

        Specified by:
        getStream in interface Value
        Returns:
        An InputStream representation of this value.
        Throws:
        RepositoryException - if an error occurs.
      • getBinary

        public Binary getBinary()
                         throws RepositoryException
        Description copied from interface: Value
        Returns a Binary representation of this value. The Binary object in turn provides methods to access the binary data itself. Uses the standard conversion to binary (see JCR specification).
        Specified by:
        getBinary in interface Value
        Returns:
        A Binary representation of this value.
        Throws:
        RepositoryException - if an error occurs.
      • getDecimal

        public java.math.BigDecimal getDecimal()
                                        throws RepositoryException
        Description copied from interface: Value
        Returns a BigDecimal representation of this value.
        Specified by:
        getDecimal in interface Value
        Returns:
        A BigDecimal representation of this value.
        Throws:
        ValueFormatException - if conversion to a BigDecimal is not possible.
        RepositoryException - if another error occurs.
      • getDate

        public java.util.Calendar getDate()
                                   throws RepositoryException
        Description copied from interface: Value
        Returns a Calendar representation of this value.

        The object returned is a copy of the stored value, so changes to it are not reflected in internal storage.

        Specified by:
        getDate in interface Value
        Returns:
        A Calendar representation of this value.
        Throws:
        ValueFormatException - if conversion to a Calendar is not possible.
        RepositoryException - if another error occurs.
      • getType

        public int getType()
        Description copied from interface: Value
        Returns the type of this Value. One of:
        • PropertyType.STRING
        • PropertyType.DATE
        • PropertyType.BINARY
        • PropertyType.DOUBLE
        • PropertyType.DECIMAL
        • PropertyType.LONG
        • PropertyType.BOOLEAN
        • PropertyType.NAME
        • PropertyType.PATH
        • PropertyType.REFERENCE
        • PropertyType.WEAKREFERENCE
        • PropertyType.URI
        See PropertyType.

        The type returned is that which was set at property creation.

        Specified by:
        getType in interface Value
        Returns:
        an int
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object