Package org.freeplane.core.util
Class FreeplaneVersion
java.lang.Object
org.freeplane.core.util.FreeplaneVersion
- All Implemented Interfaces:
Comparable<FreeplaneVersion>
,FreeplaneVersion
provides access to the current Freeplane version. In scripts use
c.freeplaneVersion
.
For usage instructions see compareTo(org.freeplane.api.FreeplaneVersion)
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionFreeplaneVersion
(int pMaj, int pMid, int pMin) FreeplaneVersion
(int pMaj, int pMid, int pMin, String pType, int pNum) -
Method Summary
Modifier and TypeMethodDescriptionint
Use it like this:int
getMaj()
int
getMid()
int
getMin()
int
getNum()
getType()
static FreeplaneVersion
static FreeplaneVersion
getVersion
(String pString) Parses a version string as FreeplaneVersion.boolean
isFinal()
boolean
isNewerThan
(FreeplaneVersion freeplaneVersion) boolean
isOlderThan
(FreeplaneVersion freeplaneVersion) returns the version number only, e.g.toString()
returns the full version number, e.g.
-
Field Details
-
VERSION_KEY
- See Also:
-
VERSION_PROPERTIES
- See Also:
-
XML_VERSION
- See Also:
-
-
Constructor Details
-
FreeplaneVersion
-
FreeplaneVersion
public FreeplaneVersion(int pMaj, int pMid, int pMin)
-
-
Method Details
-
getVersion
-
getVersion
Parses a version string as FreeplaneVersion. Ignores leading 'v' (e.g. "v1.2.6") and accept '.' and ' ' as separator.- Throws:
IllegalArgumentException
- on parse errors
-
getMaj
public int getMaj()- Specified by:
getMaj
in interfaceFreeplaneVersion
-
getMid
public int getMid()- Specified by:
getMid
in interfaceFreeplaneVersion
-
getMin
public int getMin()- Specified by:
getMin
in interfaceFreeplaneVersion
-
getNum
public int getNum()- Specified by:
getNum
in interfaceFreeplaneVersion
-
getType
- Specified by:
getType
in interfaceFreeplaneVersion
-
getRevision
- Specified by:
getRevision
in interfaceFreeplaneVersion
-
compareTo
Use it like this:import org.freeplane.core.util.FreeplaneVersion def required = FreeplaneVersion.getVersion("1.2.20") if (c.freeplaneVersion < required) ui.errorMessage("Freeplane version ${c.freeplaneVersion}" + " not supported - update to at least ${required}")
- Specified by:
compareTo
in interfaceComparable<FreeplaneVersion>
-
toString
returns the full version number, e.g. "1.0.38 rc". -
numberToString
returns the version number only, e.g. "1.0.38".- Specified by:
numberToString
in interfaceFreeplaneVersion
-
isOlderThan
- Specified by:
isOlderThan
in interfaceFreeplaneVersion
-
isNewerThan
- Specified by:
isNewerThan
in interfaceFreeplaneVersion
-
isFinal
public boolean isFinal()- Specified by:
isFinal
in interfaceFreeplaneVersion
-