Class BaseCliApplication.MetadataProvider

  • All Implemented Interfaces:
    picocli.CommandLine.IVersionProvider
    Enclosing class:
    BaseCliApplication

    protected static class BaseCliApplication.MetadataProvider
    extends java.lang.Object
    implements picocli.CommandLine.IVersionProvider
    Strategy for retrieving the application name and version from the configuration.

    This class expects a configuration file with the same name as the application class indicated in the constructor with a base extension of -config, such as ExampleApp-config.properties, loaded via Confound from the resources in the same path as the application class. For example:

     
     name=${project.name}
     version=${project.version}
     
     
    Author:
    Garret Wilson
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MetadataProvider()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getVersion()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetadataProvider

        protected MetadataProvider()
    • Method Detail

      • getVersion

        public java.lang.String[] getVersion()
                                      throws java.lang.Exception
        Specified by:
        getVersion in interface picocli.CommandLine.IVersionProvider
        Implementation Specification:
        This implementation retrieves the name from resources for the concrete application class using the resource key "version".
        Throws:
        io.confound.config.ConfigurationException - if there was an error retrieving the configured name or the name could not be found.
        java.lang.Exception
        See Also:
        BaseCliApplication.CONFIG_KEY_VERSION