Class QValueValue

  • All Implemented Interfaces:
    Value

    public final class QValueValue
    extends java.lang.Object
    implements Value
    A QValueValue provides an implementation of the Value interface representing an SPI QValue.
    • Constructor Summary

      Constructors 
      Constructor Description
      QValueValue​(QValue qvalue, NamePathResolver resolver)
      Constructs a QValueValue object representing an SPI QValue.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      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.
      QValue getQValue()
      Returns the embedded QValue.
      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.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QValueValue

        public QValueValue​(QValue qvalue,
                           NamePathResolver resolver)
        Constructs a QValueValue object representing an SPI QValue.
        Parameters:
        qvalue - the QValue this QValueValue should represent
        resolver - fore resolving namespace URIs to prefixes in NAME/PATH properties
    • Method Detail

      • getQValue

        public QValue getQValue()
        Returns the embedded QValue.
        Returns:
        the embedded QValue
      • 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.
        See Also:
        Value.getBinary()
      • 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.
        See Also:
        Value.getDate()
      • getStream

        public java.io.InputStream getStream()
                                      throws java.lang.IllegalStateException,
                                             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.
        java.lang.IllegalStateException
        See Also:
        Value.getStream()
      • 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
        See Also:
        Value.getType()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()