Interface Version

  • All Superinterfaces:
    Item, Node

    public interface Version
    extends Node
    A Version object wraps an nt:version node. It provides convenient access to version information.
    • Method Detail

      • getCreated

        java.util.Calendar getCreated()
                               throws RepositoryException
        Returns the date this version was created. This corresponds to the value of the jcr:created property in the nt:version node that represents this version.
        Returns:
        a Calendar object
        Throws:
        RepositoryException - if an error occurs.
      • getLinearSuccessor

        Version getLinearSuccessor()
                            throws RepositoryException
        Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the successor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.

        Note that under simple versioning the behavior of this method is equivalent to getting the unique successor (if any) of this version.

        Returns:
        a Version or null if no linear successor exists.
        Throws:
        RepositoryException - if an error occurs.
        See Also:
        VersionHistory.getAllLinearVersions()
      • getSuccessors

        Version[] getSuccessors()
                         throws RepositoryException
        Returns the successor versions of this version. This corresponds to returning all the nt:version nodes referenced by the jcr:successors multi-value property in the nt:version node that represents this version.

        In a simple versioning repository this method

        Returns:
        a Version array.
        Throws:
        RepositoryException - if an error occurs.
      • getLinearPredecessor

        Version getLinearPredecessor()
                              throws RepositoryException
        Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the predecessor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.

        Note that under simple versioning the behavior of this method is equivalent to getting the unique predecessor (if any) of this version.

        Returns:
        a Version or null if no linear predecessor exists.
        Throws:
        RepositoryException - if an error occurs.
        See Also:
        VersionHistory.getAllLinearVersions()
      • getPredecessors

        Version[] getPredecessors()
                           throws RepositoryException
        In both simple and full versioning repositories, this method returns the predecessor versions of this version. This corresponds to returning all the nt:version nodes whose jcr:successors property includes a reference to the nt:version node that represents this version.
        Returns:
        a Version array.
        Throws:
        RepositoryException - if an error occurs.