Table of Contents

Class JNetCLICoreHelper

Namespace
MASES.JNet.Specific.CLI
Assembly
MASES.JNet.dll

Helper class for CLI operations

public static class JNetCLICoreHelper
Inheritance
JNetCLICoreHelper
Inherited Members

Properties

ApplicationClassToRun

Sets the global value of class to run

public static string ApplicationClassToRun { get; set; }

Property Value

string

ClassToRun

The class to run in CLI version

public static string ClassToRun { get; }

Property Value

string

DefaultClassToRun

The default class to run in CLI version if neighter ApplicationClassToRun nor ClassToRun are set

public static string DefaultClassToRun { get; set; }

Property Value

string

EnableInteractive

Set to true to use Interactive

public static bool EnableInteractive { get; set; }

Property Value

bool

EnableMainClassToRun

Set to true to use MainClassToRun

public static bool EnableMainClassToRun { get; set; }

Property Value

bool

EnableRunCommand

Set to true to use RunCommand

public static bool EnableRunCommand { get; set; }

Property Value

bool

EnableScript

Set to true to use Script

public static bool EnableScript { get; set; }

Property Value

bool

ImportList

The set of imports to be associated to the execution

public static IEnumerable<string> ImportList { get; }

Property Value

IEnumerable<string>

Interactive

true if the CLI was requested in interactive mode

public static bool Interactive { get; }

Property Value

bool

JarList

The list of JARs to be added to the classpath

public static IEnumerable<string> JarList { get; }

Property Value

IEnumerable<string>

MainClassToRun

Sets the Type to be invoked at startup

public static Type MainClassToRun { get; }

Property Value

Type

NamespaceList

The set of namespaces to be associated to the execution

public static IEnumerable<string> NamespaceList { get; }

Property Value

IEnumerable<string>

true if the CLI shall not display initial informative string

public static bool NoLogo { get; }

Property Value

bool

RunCommand

The Java Main-Class to run

public static string RunCommand { get; }

Property Value

string

Script

The script to be executed

public static string Script { get; }

Property Value

string

Methods

AssemblyReferencesOf<T>()

Extract all Assembly associated to T

public static IEnumerable<Assembly> AssemblyReferencesOf<T>()

Returns

IEnumerable<Assembly>

An IEnumerable<T> containing the Assembly found from T

Type Parameters

T

The Type to parse

InitCLI<T>(JNetCoreBase<T>)

Initialize CLI

public static void InitCLI<T>(this JNetCoreBase<T> runner) where T : JNetCoreBase<T>

Parameters

runner JNetCoreBase<T>

Type Parameters

T

MainClassesFrom<TRunner>()

Retrieves the list of classes usable as Main-Class

public static IDictionary<string, Type> MainClassesFrom<TRunner>() where TRunner : JNetCoreBase<TRunner>

Returns

IDictionary<string, Type>

A IDictionary<TKey, TValue> of class name and corresponding Type

Type Parameters

TRunner

The class extending JNetCoreBase<T>

PrepareMainClassToRun(IDictionary<string, Type>, string)

Prepare MainClassToRun property

public static void PrepareMainClassToRun(this IDictionary<string, Type> on, string className)

Parameters

on IDictionary<string, Type>

The IDictionary<TKey, TValue> of class name and corresponding Type to search the class in

className string

The class to search

Exceptions

ArgumentNullException

If on is null

ArgumentException

PrepareMainClassToRun<T>(JNetCoreBase<T>, string)

Prepare MainClassToRun property

public static void PrepareMainClassToRun<T>(this JNetCoreBase<T> on, string className) where T : JNetCoreBase<T>

Parameters

on JNetCoreBase<T>

A Type contained in the Assembly where className shall be searched

className string

The class to search

Type Parameters

T

A Type contained in the Assembly where className shall be searched

ProcessCLIParsedArgs<T>(JNetCoreBase<T>, string[], Action<string>)

Process parsed args

public static string[] ProcessCLIParsedArgs<T>(this JNetCoreBase<T> runner, string[] result, Action<string> settingsCallback = null) where T : JNetCoreBase<T>

Parameters

runner JNetCoreBase<T>

The instance extending JNetCoreBase<T>

result string[]

The list of remaining command-line arguments

settingsCallback Action<string>

Callback invoked to setup parameters based on ClassToRun

Returns

string[]

Type Parameters

T

A type extending JNetCoreBase<T>

SetCLICommandLineArguments(IEnumerable<IArgumentMetadata>)

Adds command line arguments on the set managed from CommandLineArguments

public static IEnumerable<IArgumentMetadata> SetCLICommandLineArguments(this IEnumerable<IArgumentMetadata> args)

Parameters

args IEnumerable<IArgumentMetadata>

The base arguments to be integrated with command-line options

Returns

IEnumerable<IArgumentMetadata>

The new IEnumerable<T> of IArgumentMetadata

SetCLIPathToParse(IList<string>)

Set the paths to be parsed

public static IList<string> SetCLIPathToParse(this IList<string> args)

Parameters

args IList<string>

The list of paths to be extended

Returns

IList<string>

The resulting paths