public class AutomaticVersioning extends Object implements Versioning
| Constructor and Description |
|---|
AutomaticVersioning(Pattern pattern,
Route route)
Creates automatically supplied versioning information.
|
AutomaticVersioning(Pattern pattern,
String route)
Creates automatically supplied versioning information.
|
| Modifier and Type | Method and Description |
|---|---|
Version |
getDocumentVersion(Section document,
boolean defaults)
Returns version of the given document (section).
|
Version |
getFirstVersion()
Returns the first version specified by the used pattern.
|
String |
toString() |
void |
updateVersionID(Section updated,
Section def)
Sets version ID of the default section into the updated section content.
|
public AutomaticVersioning(@NotNull
Pattern pattern,
@NotNull
Route route)
The versions of the respective documents will be obtained and parsed at runtime. Please note that version ID of
the defaults must be present and valid, otherwise, a NullPointerException will be thrown. For the
document itself, if the version ID is missing or invalid, the updater assigns getFirstVersion() to it.
pattern - the pattern used to parse the IDsroute - the route at which the IDs arepublic AutomaticVersioning(@NotNull
Pattern pattern,
@NotNull
String route)
The versions of the respective documents will be obtained and parsed at runtime. Please note that version ID of
the defaults must be present and valid, otherwise, a NullPointerException will be thrown. For the
document itself, if the version ID is missing or invalid, the updater assigns getFirstVersion() to it.
pattern - the pattern used to parse the IDsroute - the route at which the IDs are@Nullable public Version getDocumentVersion(@NotNull Section document, boolean defaults)
Versioning
If obtaining version of the defaults (parameter is set to true), returning null is
considered illegal and will throw a NullPointerException. Otherwise, for the document itself, if the
version returned is null, the updater assigns Versioning.getFirstVersion() to it.
getDocumentVersion in interface Versioningdocument - the documentdefaults - if getting version of the defaultsnull if it could not be obtained/parsed@NotNull public Version getFirstVersion()
VersioninggetFirstVersion in interface VersioningPattern.getFirstVersion()public void updateVersionID(@NotNull
Section updated,
@NotNull
Section def)
Versioning
Should be used only if the underlying versioning implementation supports file manipulation (AutomaticVersioning).
updateVersionID in interface Versioningupdated - the updated sectiondef - the default section equivalentCopyright © 2022. All rights reserved.