Table of Contents

Class JNetCoreExtensions

Namespace
MASES.JNet.Specific.Extensions
Assembly
MASES.JNet.dll

Extension class

public static class JNetCoreExtensions
Inheritance
JNetCoreExtensions
Inherited Members

Methods

Class<TClass>(TClass)

Retrieve the Class<T> from the TClass

public static Class<TClass> Class<TClass>(this TClass _) where TClass : IJVMBridgeBase, new()

Parameters

_ TClass

Returns

Class<TClass>

The Class<T>

Type Parameters

TClass

A class extending MASES.JCOBridge.C2JBridge.IJVMBridgeBase

DirectBufferWithWrap<TData, TWrap>(TData[], bool, bool, int, Func<ByteBuffer, TWrap>)

The method creates a ByteBuffer and wrap it into TWrap

public static TWrap DirectBufferWithWrap<TData, TWrap>(this TData[] data, bool useMemoryControlBlock = true, bool arrangeCapacity = true, int timeToLive = -1, Func<ByteBuffer, TWrap> converter = null) where TWrap : IJVMBridgeBase, new()

Parameters

data TData[]

The array of TData to be wrapped

useMemoryControlBlock bool

Appends to the end of the data a memory block will be used to controls and arbitrates memory between CLR and JVM

arrangeCapacity bool

If true the TData array in data will be resized to the next power of 2, so capacity will be memory aligned and the limit of java.nio.ByteBuffer will be current size of data

timeToLive int

The time to live, expressed in milliseconds, the underlying memory shall remain available; if the time to live expires the pinned memory is retired leaving potentially the JVM under the possibility of an access violation.

converter Func<ByteBuffer, TWrap>

A Func<T, TResult> that receives the prepared ByteBuffer and shall return TWrap

Returns

TWrap

The TWrap instance

Type Parameters

TData

The data to be wrapped

TWrap

The wrapping class

GetStaticPropertyOn(Type, Type, string)

Generic static property getter

public static object GetStaticPropertyOn(this Type origin, Type target, string propertyName)

Parameters

origin Type

The origin

target Type

The target Type where the static property was defined

propertyName string

The property name

Returns

object

The property value

GetStaticPropertyOn<TContainingClass>(Type, string)

Generic static property getter

public static object GetStaticPropertyOn<TContainingClass>(this Type origin, string propertyName)

Parameters

origin Type

The origin

propertyName string

The property name

Returns

object

The property value

Type Parameters

TContainingClass

The target Type where the static property was defined

RunStaticMethodOn(Type, Type, string, params object[])

Executes a static method defined in destination

public static object RunStaticMethodOn(this Type origin, Type destination, string methodName, params object[] args)

Parameters

origin Type

The origin

destination Type

The target Type where the static method was defined

methodName string

The method name

args object[]

The method arguments

Returns

object

The method result

RunStaticMethodOn(Type, Type, string, Type[], params object[])

Executes a static method defined in destination

public static object RunStaticMethodOn(this Type origin, Type destination, string methodName, Type[] types, params object[] args)

Parameters

origin Type

The origin

destination Type

The target Type where the static method was defined

methodName string

The method name

types Type[]

The Type of the arguments

args object[]

The method arguments

Returns

object

The method result

RunStaticMethodOn<TContainingClass>(Type, string, params object[])

Executes a static method defined in source

public static object RunStaticMethodOn<TContainingClass>(this Type source, string methodName, params object[] args)

Parameters

source Type

The origin

methodName string

The method name

args object[]

The method arguments

Returns

object

The method result

Type Parameters

TContainingClass

The target Type where the static method was defined

SetStaticPropertyOn(Type, Type, string, object)

Generic static property setter

public static void SetStaticPropertyOn(this Type origin, Type destination, string propertyName, object value)

Parameters

origin Type

The origin

destination Type

The target Type where the static property was defined

propertyName string

The property name

value object

The property value

SetStaticPropertyOn<TContainingClass>(Type, string, object)

Generic static property setter

public static void SetStaticPropertyOn<TContainingClass>(this Type origin, string propertyName, object value)

Parameters

origin Type

The origin

propertyName string

The property name

value object

The property value

Type Parameters

TContainingClass

The target Type where the static property was defined

TraverseUntil(Type, Type)

Traverse the class chain from source until t

public static Type TraverseUntil(this Type source, Type t)

Parameters

source Type

The source

t Type

The target

Returns

Type

The Type found