APIs for Java Developers
Go to APIs for .NET Developers (coming soon)com.javonet.api.generics
Class NGenericStaticMethod
- java.lang.Object
-
- com.javonet.api.generics.NGenericStaticMethod
-
public class NGenericStaticMethod extends java.lang.Object
-
Constructor Summary
Constructors Constructor and Description NGenericStaticMethod(com.javonet.internal.IGateway gm,
java.lang.Integer objectId,
NType[] genericTypes)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description <T> T
invoke(java.lang.String methodName)
Invokes any parameter-less generic method on associated .NET object and returns result.<T> T
invoke(java.lang.String methodName,
java.lang.Object... parameters)Invokes any generic method with parameters on associated .NET object and returns result.
-
Constructor Detail
-
NGenericStaticMethod
public NGenericStaticMethod(com.javonet.internal.IGateway gm, java.lang.Integer objectId, NType[] genericTypes)
-
Method Detail
-
invoke
public <T> T invoke(java.lang.String methodName) throws JavonetException
Invokes any parameter-less generic method on associated .NET object and returns result.For primitive-type results appropriate JAVA primitive type will be returned (string, integer, float…)
If reference-type results instance of another NObject will be returned associated to returned .NET object.
For void results NULL will be returned.
- Type Parameters:
T
– JAVA type to which the result returned by invoked method will be casted. Provide either JAVA value type like: integer, string, boolean or for reference type results please use NObject- Parameters:
methodName
– Name of the method to be invoked- Returns:
- Result of method invocation. It can be JAVA primitive type (string, integer, float) or instance of another NObject
- Throws:
JavonetException
– If .NET exception occurs during method invocation- See Also:
NObject.invoke(String, Object...)
-
invoke
public <T> T invoke(java.lang.String methodName, java.lang.Object... parameters) throws JavonetException
Invokes any generic method with parameters on associated .NET object and returns result.Parameters can be specified as any JAVA primitive type or instance of another NObject to pass reference to another .NET object.
For primitive-type results appropriate JAVA primitive type will be returned (String, Integer, Float…)
If reference-type results instance of another NObject will be returned associated to returned .NET object.
For void results NULL will be returned.
- Type Parameters:
T
– JAVA type to which the result returned by invoked method will be casted. Provide either JAVA value type like: integer, string, boolean or for reference type results please use NObject- Parameters:
methodName
– Name of the method to be invokedparameters
– Input parameters for method to be invoked. It can be JAVA primitive types or NObject to pass .NET reference- Returns:
- Result of method invocation. It can be JAVA primitive type (string, integer, float) or instance of another NObject
- Throws:
JavonetException
– If .NET exception occurs during method invocation
-