Package javax.jcr.version
Interface Version
-
-
Field Summary
-
Fields inherited from interface javax.jcr.Node
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VersionHistory
getContainingHistory()
Returns theVersionHistory
that contains thisVersion
.java.util.Calendar
getCreated()
Returns the date this version was created.Node
getFrozenNode()
Returns the frozen node of this version.Version
getLinearPredecessor()
Assuming that thisVersion
object was acquired through aWorkspace
W
and is within theVersionHistory
H
, this method returns the predecessor of this version along the same line of descent as is returned byH.getAllLinearVersions()
whereH
was also acquired throughW
.Version
getLinearSuccessor()
Assuming that thisVersion
object was acquired through aWorkspace
W
and is within theVersionHistory
H
, this method returns the successor of this version along the same line of descent as is returned byH.getAllLinearVersions()
whereH
was also acquired throughW
.Version[]
getPredecessors()
In both simple and full versioning repositories, this method returns the predecessor versions of this version.Version[]
getSuccessors()
Returns the successor versions of this version.-
Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
-
Methods inherited from interface javax.jcr.Node
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, removeShare, removeSharedSet, restore, restore, restore, restoreByLabel, setPrimaryType, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
-
-
-
-
Method Detail
-
getContainingHistory
VersionHistory getContainingHistory() throws RepositoryException
Returns theVersionHistory
that contains thisVersion
.- Returns:
- the
VersionHistory
that contains thisVersion
. - Throws:
RepositoryException
- if an error occurs.
-
getCreated
java.util.Calendar getCreated() throws RepositoryException
Returns the date this version was created. This corresponds to the value of thejcr:created
property in thent:version
node that represents this version.- Returns:
- a
Calendar
object - Throws:
RepositoryException
- if an error occurs.
-
getLinearSuccessor
Version getLinearSuccessor() throws RepositoryException
Assuming that thisVersion
object was acquired through aWorkspace
W
and is within theVersionHistory
H
, this method returns the successor of this version along the same line of descent as is returned byH.getAllLinearVersions()
whereH
was also acquired throughW
.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
ornull
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 thent:version
nodes referenced by thejcr:successors
multi-value property in thent: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 thisVersion
object was acquired through aWorkspace
W
and is within theVersionHistory
H
, this method returns the predecessor of this version along the same line of descent as is returned byH.getAllLinearVersions()
whereH
was also acquired throughW
.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
ornull
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 thent:version
nodes whosejcr:successors
property includes a reference to thent:version
node that represents this version.- Returns:
- a
Version
array. - Throws:
RepositoryException
- if an error occurs.
-
getFrozenNode
Node getFrozenNode() throws RepositoryException
Returns the frozen node of this version.- Returns:
- a
Node
object - Throws:
RepositoryException
- if an error occurs.- Since:
- JCR 2.0
-
-