public class ComponentInfo extends Object
It works by interrogating the class passed to the initialize() method. Current implementation retrieves the version information from the jar that the passed in class had been loaded from, if any.
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentInfo.Version
Version info - purely a data class.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION_FORMAT_PATTERN
Supported version format pattern
|
| Constructor and Description |
|---|
ComponentInfo() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentInfo.Version |
getVersion()
Get the version info part of the ComponentInfo.
|
static void |
initialize()
Initialize the ComponentInfo by retrieving all the necessary information
from the available sources.
|
static void |
initialize(Class<?> klass)
Initialize the ComponentInfo by retrieving all the necessary information
from the available sources.
|
static void |
initialize(ComponentInfo.Version version)
Initialize the ComponentInfo by explicitly passing it a
ComponentInfo.Version. |
public static final String VERSION_FORMAT_PATTERN
public static ComponentInfo.Version getVersion()
IllegalStateException - if the ComponentInfo has not been initializedpublic static void initialize()
throws Exception
Exception - if unable to complete the initializationpublic static void initialize(Class<?> klass) throws Exception
klass - that should be interrogatedException - if unable to complete the initializationpublic static void initialize(ComponentInfo.Version version)
ComponentInfo.Version.version - that should be storedCopyright © 2020. All rights reserved.