Class LabelVersionSelector
- java.lang.Object
- 
- org.apache.jackrabbit.core.version.LabelVersionSelector
 
- 
- All Implemented Interfaces:
- VersionSelector
 
 public class LabelVersionSelector extends Object implements VersionSelector This Class implements a version selector that selects a version by label.V1.0 V1.1 - "foo" new LabelVersionSelector("foo").select() --> V1.1 new LabelVersionSelector("bar").select() --> null
- 
- 
Constructor SummaryConstructors Constructor Description LabelVersionSelector(Name label)Creates aLabelVersionSelectorthat will try to select a version with the given label.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NamegetLabel()Returns the label hintInternalVersionselect(InternalVersionHistory versionHistory)Selects a version of the given version history.static InternalVersionselectByLabel(InternalVersionHistory history, Name label)Selects a version by labelvoidsetLabel(Name label)Sets the label hintStringtoString()returns debug information
 
- 
- 
- 
Constructor Detail- 
LabelVersionSelectorpublic LabelVersionSelector(Name label) Creates aLabelVersionSelectorthat will try to select a version with the given label.- Parameters:
- label- label hint
 
 
- 
 - 
Method Detail- 
getLabelpublic Name getLabel() Returns the label hint- Returns:
- the label hint.
 
 - 
setLabelpublic void setLabel(Name label) Sets the label hint- Parameters:
- label- label hint
 
 - 
selectpublic InternalVersion select(InternalVersionHistory versionHistory) throws RepositoryException Selects a version of the given version history. If this VersionSelector is unable to select one, it can returnnull. Please note, that a version selector is not allowed to return the root version. Selects a version from the given version history using the previously assigned hint in the following order: name, label, date, latest.- Specified by:
- selectin interface- VersionSelector
- Parameters:
- versionHistory- version history to select a version from
- Returns:
- A version or null.
- Throws:
- RepositoryException- if an error occurs.
 
 - 
selectByLabelpublic static InternalVersion selectByLabel(InternalVersionHistory history, Name label) throws RepositoryException Selects a version by label- Parameters:
- history- history to select from
- label- desired label
- Returns:
- the version with the given label or null
- Throws:
- RepositoryException- if an error occurs
 
 
- 
 
-