Class BaseValue

    • 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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getType

        public int getType()
        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
      • getDate

        public java.util.Calendar getDate()
                                   throws ValueFormatException,
                                          java.lang.IllegalStateException,
                                          RepositoryException
        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.
        java.lang.IllegalStateException
      • getStream

        public java.io.InputStream getStream()
                                      throws java.lang.IllegalStateException,
                                             RepositoryException
        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.
        java.lang.IllegalStateException
      • getString

        public java.lang.String getString()
                                   throws ValueFormatException,
                                          java.lang.IllegalStateException,
                                          RepositoryException
        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.
        java.lang.IllegalStateException - if getStream has previously been called on this Value instance. In this case a new Value instance must be acquired in order to successfully call this method.
        RepositoryException - if another error occurs.