APIs for Java Developers

Go to APIs for .NET Developers

com.javonet.api.generics

Class NGenericMethod

  • java.lang.Object
    • com.javonet.api.generics.NGenericMethod

  • public class NGenericMethod
    extends java.lang.Object


    • Constructor Summary

      Constructors 
      Constructor and Description
      NGenericMethod(com.javonet.internal.IGateway gm,
      java.lang.String 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.


      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait



    • Constructor Detail



      • NGenericMethod

        public NGenericMethod(com.javonet.internal.IGateway gm,
                              java.lang.String 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 invoked
        parameters – 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