Class QValueFactoryLogger

    • Constructor Summary

      Constructors 
      Constructor Description
      QValueFactoryLogger​(QValueFactory qValueFactory, LogWriter writer)
      Create a new instance for the given qValueFactory which uses writer for persisting log messages.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      QValue[] computeAutoValues​(QPropertyDefinition propertyDefinition)
      Given the QPropertyDefinition of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.
      QValue create​(boolean value)
      Create a new QValue with type PropertyType.BOOLEAN.
      QValue create​(byte[] value)
      Create a new QValue with type PropertyType.BINARY.
      QValue create​(double value)
      Create a new QValue with type PropertyType.DOUBLE.
      QValue create​(long value)
      Create a new QValue with type PropertyType.LONG.
      QValue create​(java.io.File value)
      Create a new QValue with type PropertyType.BINARY.
      QValue create​(java.io.InputStream value)
      Creates a QValue that contains the given binary stream.
      QValue create​(java.lang.String value, int type)
      Create a new QValue using the given String representation of the value and its type.
      QValue create​(java.math.BigDecimal value)
      Create a new QValue with type PropertyType.DECIMAL.
      QValue create​(java.net.URI value)
      Create a new QValue with type PropertyType.URI.
      QValue create​(java.util.Calendar value)
      Create a new QValue with type PropertyType.DATE.
      QValue create​(Name value)
      Create a new QValue with type PropertyType.NAME.
      QValue create​(Path value)
      Create a new QValue with type PropertyType.PATH.
      QValueFactory getQValueFactory()  
      • Methods inherited from class java.lang.Object

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

      • QValueFactoryLogger

        public QValueFactoryLogger​(QValueFactory qValueFactory,
                                   LogWriter writer)
        Create a new instance for the given qValueFactory which uses writer for persisting log messages.
        Parameters:
        qValueFactory -
        writer -
    • Method Detail

      • getQValueFactory

        public QValueFactory getQValueFactory()
        Returns:
        the wrapped QValueFactory
      • create

        public QValue create​(java.lang.String value,
                             int type)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue using the given String representation of the value and its type.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - String representation of the new QValue. Note, that the given String must never be null.
        type - A valid type.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.ValueFormatException - If the given value cannot be converted to the specified type.
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        QValue.getType()
      • create

        public QValue create​(java.util.Calendar value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.DATE.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A non-null Calendar object acting as value of the new QValue.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(double value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.DOUBLE.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A double containing the value of the new QValue.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(long value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.LONG.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A long containing the value of the new QValue.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(boolean value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.BOOLEAN.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A boolean containing the value of the new QValue.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(Name value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.NAME.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A non-null Name.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(Path value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.PATH.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A non-null Path.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(java.net.URI value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.URI.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A non-null URI.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(java.math.BigDecimal value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.DECIMAL.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - A non-null BigDecimal.
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(byte[] value)
                      throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.BINARY.
        Specified by:
        create in interface QValueFactory
        Returns:
        a new QValue.
        Throws:
        javax.jcr.RepositoryException
      • create

        public QValue create​(java.io.InputStream value)
                      throws javax.jcr.RepositoryException,
                             java.io.IOException
        Description copied from interface: QValueFactory
        Creates a QValue that contains the given binary stream. The given stream is consumed and closed by this method. The type of the resulting QValue will be PropertyType.BINARY.
        Specified by:
        create in interface QValueFactory
        Parameters:
        value - binary stream
        Returns:
        a new binary QValue.
        Throws:
        javax.jcr.RepositoryException - if the value could not be created
        java.io.IOException - if the stream can not be consumed
      • create

        public QValue create​(java.io.File value)
                      throws javax.jcr.RepositoryException,
                             java.io.IOException
        Description copied from interface: QValueFactory
        Create a new QValue with type PropertyType.BINARY.
        Specified by:
        create in interface QValueFactory
        Returns:
        a new binary QValue.
        Throws:
        java.io.IOException
        javax.jcr.RepositoryException
      • computeAutoValues

        public QValue[] computeAutoValues​(QPropertyDefinition propertyDefinition)
                                   throws javax.jcr.RepositoryException
        Description copied from interface: QValueFactory
        Given the QPropertyDefinition of an autocreated property, compute suitable values to be used in transient space until the newly created node gets saved.
        Specified by:
        computeAutoValues in interface QValueFactory
        Parameters:
        propertyDefinition - definition of property for which values should be created
        Returns:
        computed value
        Throws:
        javax.jcr.RepositoryException