org.appng.cli

## Class CliEnvironment

- java.lang.Object
- - org.appng.cli.CliEnvironment

-     public class CliEnvironment
      extends Object

  Holds informations about the environment when executing `ExecutableCliCommand`s.
  Author:
    Matthias Herlitzius

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static PrintStream` | `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CliEnvironment(org.springframework.context.ApplicationContext platformContext, Properties cliConfig)` Creates a new `CliEnvironment`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Properties` | `getCliConfig()` Retrieves the cli configuration
    `org.springframework.context.ApplicationContext` | `getContext()` Retrieves the `ApplicationContext`.
    `CoreService` | `getCoreService()` Retrieves a `CoreService` from the `ApplicationContext`.
    `org.springframework.context.MessageSource` | `getMessageSource()`
    `Properties` | `getPlatformConfig()` Returns the appNG platform configuration.
    `String` | `getResult()` Retrieves the result of a `ExecutableCliCommand`-execution, which is a string to output on the console.
    `void` | `initPlatform(Properties defaultOverrides)` Initialized the appNG platform.
    `void` | `setResult(String result)` Sets the result of a `ExecutableCliCommand`-execution, which is a string to output on the console.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### out

          public static PrintStream out

  - ### Constructor Detail

    - #### CliEnvironment

          public CliEnvironment(org.springframework.context.ApplicationContext platformContext,
                                Properties cliConfig)

      Creates a new `CliEnvironment`.
      Parameters:
        `platformContext` - the `ApplicationContext` used
        `cliConfig` - the configuration read from "/conf/appNG.properties"

  - ### Method Detail

    - #### initPlatform

          public void initPlatform(Properties defaultOverrides)

      Initialized the appNG platform.

    - #### getPlatformConfig

          public Properties getPlatformConfig()

      Returns the appNG platform configuration.
      Returns:
        the appNG platform configuration

    - #### getCoreService

          public CoreService getCoreService()

      Retrieves a `CoreService` from the `ApplicationContext`.
      Returns:
        the `CoreService`

    - #### setResult

          public void setResult(String result)

      Sets the result of a `ExecutableCliCommand`-execution, which is a string to output on the console.
      Parameters:
        `result` - the result to set

    - #### getResult

          public String getResult()

      Retrieves the result of a `ExecutableCliCommand`-execution, which is a string to output on the console.

    - #### getContext

          public org.springframework.context.ApplicationContext getContext()

      Retrieves the `ApplicationContext`.
      Returns:
        the `ApplicationContext`

    - #### getCliConfig

          public Properties getCliConfig()

      Retrieves the cli configuration
      Returns:
        the configuration read from "/conf/appNG.properties"

    - #### getMessageSource

          public org.springframework.context.MessageSource getMessageSource()

Copyright © 2011–2023 aiticon GmbH. All rights reserved.