Package org.oorexx.clr

# Class Helper4ooRexx4Net

java.lang.Object
org.oorexx.clr.Helper4ooRexx4Net

public class Helper4ooRexx4Net extends Object
This class helps the ooRexx dynamic language coders to box and unbox numeric values into the common language runtime (CLR) wrapper classes. This class can be used for any other such dynamic language that uses strings to represent numeric values.

Since:
  2016-06-13
Version:
  001.201600613
Author:
  Rony G. Flatscher

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static system.IFormatProvider`
  `ifpCultureNeutral`
  Culture neutral `IFormatProvider` for allowing to parse and create Rexx decimal numbers using the point (dot) character for the decimal point.
  `static final String`
  `version`
  Version field, major version before dot, date of version after dot.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Helper4ooRexx4Net()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static system.Object`
  `clr_box(String typeIndicator, String value)`
  Create and return an instance of the `typeIndicator` Wrapper class representing the `value` or turn a `java.lang.String` into a `System.String` and return it.
  `static Object`
  `clr_unbox(system.Object o)`
  Utility method for "oorexx.net" to turn values of `clr` primitive types and or System.String values to plain strings, otherwise returns argument unchanged.
  `static Map`
  `getCultureNeutralParseMethods()`
  Returns an unmodifiable `Map` of `miCultureNeutralParseMethods` to allow inspection and usage.
  `static Map`
  `getCultureNeutralToStringMethods()`
  Returns an unmodifiable `Map` of `miCultureNeutralToStringMethods` to allow inspection and usage.
  `static String`
  `getFieldName(system.Type t, String argName)`
  Searches a field in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `FieldInfo` object.
  `static String`
  `getMethodName(system.Type t, String argName)`
  Searches a method in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `MethodInfo` object.
  `static Map`
  `getPrimitiveWrapperClasses()`
  Returns an unmodifiable `Map` of `tiPrimitiveWrapperClasses` to allow inspection and usage.
  `static String`
  `getPropertyName(system.Type t, String argName)`
  Searches a property in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `PropertyInfo` object.
  `static boolean`
  `isDebug()`
  Getter method for field `bDebug`.
  `static boolean`
  `isVerbose()`
  Getter method for field `bVerbose`.
  `static void`
  `main(String[] args)`
  `main` method.
  `static void`
  `setDebug(boolean DebugMode)`
  Setter method for field `bDebug`.
  `static void`
  `setVerbose(boolean verboseMode)`
  Setter method for field `bVerbose`.

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

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

- ## Field Details

  - ### version

    public static final String version
    Version field, major version before dot, date of version after dot.
    See Also:
      - Constant Field Values

  - ### ifpCultureNeutral

    public static system.IFormatProvider ifpCultureNeutral
    Culture neutral `IFormatProvider` for allowing to parse and create Rexx decimal numbers using the point (dot) character for the decimal point. Affects boxing and unboxing of "System.Decimal", "System.Single" and and "System.Double".

- ## Constructor Details

  - ### Helper4ooRexx4Net

    public Helper4ooRexx4Net()

- ## Method Details

  - ### isVerbose

    public static boolean isVerbose()
    Getter method for field `bVerbose`.
    Returns:
      whether verbose mode is active

  - ### setVerbose

    public static void setVerbose(boolean verboseMode)
    Setter method for field `bVerbose`.
    Parameters:
      `verboseMode` - to use from now on

  - ### isDebug

    public static boolean isDebug()
    Getter method for field `bDebug`.
    Returns:
      whether Debug mode is active

  - ### setDebug

    public static void setDebug(boolean DebugMode)
    Setter method for field `bDebug`.
    Parameters:
      `DebugMode` - to use from now on

  - ### getPrimitiveWrapperClasses

    public static Map getPrimitiveWrapperClasses()
    Returns an unmodifiable `Map` of `tiPrimitiveWrapperClasses` to allow inspection and usage.
    Returns:
      unmodifiable `Map` of `tiPrimitiveWrapperClasses`

  - ### getCultureNeutralParseMethods

    public static Map getCultureNeutralParseMethods()
    Returns an unmodifiable `Map` of `miCultureNeutralParseMethods` to allow inspection and usage.
    Returns:
      unmodifiable `Map` of `miCultureNeutralParseMethods`

  - ### getCultureNeutralToStringMethods

    public static Map getCultureNeutralToStringMethods()
    Returns an unmodifiable `Map` of `miCultureNeutralToStringMethods` to allow inspection and usage.
    Returns:
      unmodifiable `Map` of `miCultureNeutralToStringMethods`

  - ### main

    public static void main(String[] args) throws IOException
    `main` method.
    Parameters:
      `args` - command line arguments, not used
    Throws:
      `IOException` - raised if a problem occurs while initializing the `Bridge`.

  - ### clr_unbox

    public static Object clr_unbox(system.Object o)
    Utility method for "oorexx.net" to turn values of `clr` primitive types and or System.String values to plain strings, otherwise returns argument unchanged.
    Parameters:
      `o` - a .net object of type `system.Object`
    Returns:
      the primitive .net value or .net string as a Java String, or the argument unchanged

  - ### clr_box

    public static system.Object clr_box(String typeIndicator, String value)
    Create and return an instance of the `typeIndicator` Wrapper class representing the `value` or turn a `java.lang.String` into a `System.String` and return it.
    Parameters:
      `typeIndicator` - one of (only capital letters need to be given) "STring" (return the value as string), or return a boxed `value` according to the following table:

      Values for `typeIndicator` argument and the CLR class to which to box.
      typeIndicator | returns boxed value of type
      --- | ---
      "BOolean" | "System.Boolean"
      "BYte" | "System.Byte"
      "Char" | "System.Char"
      "DEcimal" | "System.Decimal"
      "DOuble" | "System.Double"
      "I16" | "System.Int16"
      "I32" | "System.Int32"
      "I64" | "System.Int64"
      "INT16" | "System.Int16"
      "INT32" | "System.Int32"
      "INT64" | "System.Int64"
      "SByte" | "System.SByte"
      "SIngle" | "System.Single"
      "STring" | "System.String"
      "UI16" | "System.UInt16"
      "UI32" | "System.UInt32"
      "UI64" | "System.UInt64"
      "UINT16" | "System.UInt16"
      "UINT32" | "System.UInt32"
      "UINT64" | "System.UInt64"

      `value` - a string containing the value to be boxed
    Returns:
      returns boxed value, in the case of a string the value as a `system.String` object, `null` if `null` was supplied as the `value` parameter or the boxed object.

  - ### getMethodName

    public static String getMethodName(system.Type t, String argName)
    Searches a method in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `MethodInfo` object.
    Parameters:
      `t` - the `system.Type` object to look for the method's name
      `argName` - the name of a method we seek
    Returns:
      the properly spelled name of the method or `null` if none was found

  - ### getPropertyName

    public static String getPropertyName(system.Type t, String argName)
    Searches a property in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `PropertyInfo` object.
    Parameters:
      `t` - the `system.Type` object to look for the property's name
      `argName` - the name of a property we seek
    Returns:
      the properly spelled name of the property or `null` if none was found

  - ### getFieldName

    public static String getFieldName(system.Type t, String argName)
    Searches a field in the supplied type which matches caselessly the supplied needle and returns the spelling found in the `FieldInfo` object.
    Parameters:
      `t` - the `system.Type` object to look for the field's name
      `argName` - the name of a field we seek
    Returns:
      the properly spelled name of the field or `null` if none was found