public abstract class AbstractVersionProvider extends Object implements VersionProvider
VersionProvider
implementationsModifier and Type | Field and Description |
---|---|
protected String |
defaultValue
The default value to use when no version is found, defaults to
VersionProvider.SKIP |
protected org.slf4j.Logger |
logger |
SKIP, VERSION
Constructor and Description |
---|
AbstractVersionProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
doGetVersion(Object target) |
protected abstract void |
doSetVersion(Object target,
String version) |
String |
getVersion(Object target)
Returns the current version
|
void |
setDefaultValue(String defaultValue) |
void |
setVersion(Object target,
String version)
Updates the current version
|
protected org.slf4j.Logger logger
protected String defaultValue
VersionProvider.SKIP
public void setDefaultValue(String defaultValue)
public String getVersion(Object target) throws UpgradeException
VersionProvider
getVersion
in interface VersionProvider
target
- the targetUpgradeException
- if there is any error getting the current versionprotected abstract String doGetVersion(Object target) throws Exception
Exception
public void setVersion(Object target, String version) throws UpgradeException
VersionProvider
setVersion
in interface VersionProvider
target
- the targetversion
- the new versionUpgradeException
- if there is any error setting the current versionCopyright © 2023 CrafterCMS. All rights reserved.