Class JNetCLICoreHelper
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
ClassToRun
The class to run in CLI version
public static string ClassToRun { get; }
Property Value
DefaultClassToRun
The default class to run in CLI version if neighter ApplicationClassToRun nor ClassToRun are set
public static string DefaultClassToRun { get; set; }
Property Value
EnableInteractive
Set to true to use Interactive
public static bool EnableInteractive { get; set; }
Property Value
EnableMainClassToRun
Set to true to use MainClassToRun
public static bool EnableMainClassToRun { get; set; }
Property Value
EnableRunCommand
Set to true to use RunCommand
public static bool EnableRunCommand { get; set; }
Property Value
EnableScript
public static bool EnableScript { get; set; }
Property Value
ImportList
The set of imports to be associated to the execution
public static IEnumerable<string> ImportList { get; }
Property Value
Interactive
true if the CLI was requested in interactive mode
public static bool Interactive { get; }
Property Value
JarList
The list of JARs to be added to the classpath
public static IEnumerable<string> JarList { get; }
Property Value
MainClassToRun
Sets the Type to be invoked at startup
public static Type MainClassToRun { get; }
Property Value
NamespaceList
The set of namespaces to be associated to the execution
public static IEnumerable<string> NamespaceList { get; }
Property Value
NoLogo
true if the CLI shall not display initial informative string
public static bool NoLogo { get; }
Property Value
RunCommand
The Java Main-Class to run
public static string RunCommand { get; }
Property Value
Script
The script to be executed
public static string Script { get; }
Property Value
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
stringThe 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 searchedclassName
stringThe class to search
Type Parameters
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)