Package org.oorexx.clr
Class Helper4ooRexx4Net
java.lang.Object
org.oorexx.clr.Helper4ooRexx4Net
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
FieldsModifier and TypeFieldDescriptionstatic system.IFormatProviderCulture neutralIFormatProviderfor allowing to parse and create Rexx decimal numbers using the point (dot) character for the decimal point.static final StringVersion field, major version before dot, date of version after dot. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic system.ObjectCreate and return an instance of thetypeIndicatorWrapper class representing thevalueor turn ajava.lang.Stringinto aSystem.Stringand return it.static Objectclr_unbox(system.Object o) Utility method for "oorexx.net" to turn values ofclrprimitive types and or System.String values to plain strings, otherwise returns argument unchanged.static MapReturns an unmodifiableMapofmiCultureNeutralParseMethodsto allow inspection and usage.static MapReturns an unmodifiableMapofmiCultureNeutralToStringMethodsto allow inspection and usage.static StringgetFieldName(system.Type t, String argName) Searches a field in the supplied type which matches caselessly the supplied needle and returns the spelling found in theFieldInfoobject.static StringgetMethodName(system.Type t, String argName) Searches a method in the supplied type which matches caselessly the supplied needle and returns the spelling found in theMethodInfoobject.static MapReturns an unmodifiableMapoftiPrimitiveWrapperClassesto allow inspection and usage.static StringgetPropertyName(system.Type t, String argName) Searches a property in the supplied type which matches caselessly the supplied needle and returns the spelling found in thePropertyInfoobject.static booleanisDebug()Getter method for fieldbDebug.static booleanGetter method for fieldbVerbose.static voidmainmethod.static voidsetDebug(boolean DebugMode) Setter method for fieldbDebug.static voidsetVerbose(boolean verboseMode) Setter method for fieldbVerbose.
-
Field Details
-
version
Version field, major version before dot, date of version after dot.- See Also:
-
ifpCultureNeutral
public static system.IFormatProvider ifpCultureNeutralCulture neutralIFormatProviderfor 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 fieldbVerbose.- Returns:
- whether verbose mode is active
-
setVerbose
public static void setVerbose(boolean verboseMode) Setter method for fieldbVerbose.- Parameters:
verboseMode- to use from now on
-
isDebug
public static boolean isDebug()Getter method for fieldbDebug.- Returns:
- whether Debug mode is active
-
setDebug
public static void setDebug(boolean DebugMode) Setter method for fieldbDebug.- Parameters:
DebugMode- to use from now on
-
getPrimitiveWrapperClasses
Returns an unmodifiableMapoftiPrimitiveWrapperClassesto allow inspection and usage.- Returns:
- unmodifiable
MapoftiPrimitiveWrapperClasses
-
getCultureNeutralParseMethods
Returns an unmodifiableMapofmiCultureNeutralParseMethodsto allow inspection and usage.- Returns:
- unmodifiable
MapofmiCultureNeutralParseMethods
-
getCultureNeutralToStringMethods
Returns an unmodifiableMapofmiCultureNeutralToStringMethodsto allow inspection and usage.- Returns:
- unmodifiable
MapofmiCultureNeutralToStringMethods
-
main
mainmethod.- Parameters:
args- command line arguments, not used- Throws:
IOException- raised if a problem occurs while initializing theBridge.
-
clr_unbox
Utility method for "oorexx.net" to turn values ofclrprimitive types and or System.String values to plain strings, otherwise returns argument unchanged.- Parameters:
o- a .net object of typesystem.Object- Returns:
- the primitive .net value or .net string as a Java String, or the argument unchanged
-
clr_box
Create and return an instance of thetypeIndicatorWrapper class representing thevalueor turn ajava.lang.Stringinto aSystem.Stringand return it.- Parameters:
typeIndicator- one of (only capital letters need to be given) "STring" (return the value as string), or return a boxedvalueaccording to the following table:Values for typeIndicatorargument 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.Stringobject,nullifnullwas supplied as thevalueparameter or the boxed object.
-
getMethodName
Searches a method in the supplied type which matches caselessly the supplied needle and returns the spelling found in theMethodInfoobject.- Parameters:
t- thesystem.Typeobject to look for the method's nameargName- the name of a method we seek- Returns:
- the properly spelled name of the method or
nullif none was found
-
getPropertyName
Searches a property in the supplied type which matches caselessly the supplied needle and returns the spelling found in thePropertyInfoobject.- Parameters:
t- thesystem.Typeobject to look for the property's nameargName- the name of a property we seek- Returns:
- the properly spelled name of the property or
nullif none was found
-
getFieldName
Searches a field in the supplied type which matches caselessly the supplied needle and returns the spelling found in theFieldInfoobject.- Parameters:
t- thesystem.Typeobject to look for the field's nameargName- the name of a field we seek- Returns:
- the properly spelled name of the field or
nullif none was found
-