com.hp.lft.sdk

Interface NativeObject



  • public interface NativeObject
    Exposes invocation capabilities available for native objects that were returned by the NativeObject method.
    • Method Summary

      Modifier and TypeMethod and Description
      <T> TgetItem(java.lang.Class<T> returnType, int index)
      Calls the index getter with the specified index and casts the return value to the specified returnType.
      <T> TgetItem(java.lang.Class<T> returnType, int[] indexes)
      Calls the index getter with the specified indexes (for multidimensional indexers) and casts the return value to the specified returnType.
      java.util.List<java.lang.String>getMembers()
      Returns the list of available native operations for an application object.
      In some technologies and browsers, the names of the method parameters are included and properties without a setter include a [ReadOnly] suffix.
      For additional implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
      <T> TgetProperty(java.lang.String propertyName, java.lang.Class<T> returnType)
      Calls the getter of the specified property and casts the return value to the specified returnType.
      You can retrieve the list of available native operations for an object using the getMembers method.
      For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
      <T> TinvokeMethod(java.lang.String methodName, java.lang.Class<T> returnType, java.lang.Object... args)
      Calls the specified native method using the supplied arguments and casts the return value to the specified returnType.
      You can retrieve the list of available native operations for an object using the getMembers method.
      For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
      voidinvokeMethod(java.lang.String methodName, java.lang.Object... args)
      Calls the specified native method using the supplied arguments.
      You can retrieve the list of available native operations for an object using the getMembers method.
      For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
      voidsetItem(int[] indexes, java.lang.Object value)
      Calls the indexes (for multidimensional indexers) setter with the specified index value.
      voidsetItem(int index, java.lang.Object value)
      Calls the index setter with the specified index value.
      voidsetProperty(java.lang.String propertyName, java.lang.Object value)
      Calls the setter of the specified property.
      You can retrieve the list of available native operations for an object using the getMembers method.
      For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
    • Method Detail

      • invokeMethod

        void invokeMethod(java.lang.String methodName,
                          java.lang.Object... args)
                   throws GeneralLeanFtException
        Calls the specified native method using the supplied arguments.
        You can retrieve the list of available native operations for an object using the getMembers method.
        For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
        Parameters:
        methodName - the name of the native method to call.
        args - the method arguments.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • invokeMethod

        <T> T invokeMethod(java.lang.String methodName,
                           java.lang.Class<T> returnType,
                           java.lang.Object... args)
                    throws GeneralLeanFtException
        Calls the specified native method using the supplied arguments and casts the return value to the specified returnType.
        You can retrieve the list of available native operations for an object using the getMembers method.
        For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
        Type Parameters:
        T - the type of the expected return value.
        Parameters:
        methodName - the name of the native method to call.
        returnType - the expected value type of the return value.
        args - the method arguments.
        Returns:
        the return value of the called native method, cast to the specified returnType.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • getProperty

        <T> T getProperty(java.lang.String propertyName,
                          java.lang.Class<T> returnType)
                   throws GeneralLeanFtException
        Calls the getter of the specified property and casts the return value to the specified returnType.
        You can retrieve the list of available native operations for an object using the getMembers method.
        For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
        Type Parameters:
        T - the type of the expected return value.
        Parameters:
        propertyName - the name of the native property to get.
        returnType - the expected value type of the return value.
        Returns:
        the return value of the called native property, cast to the specified returnType.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • setProperty

        void setProperty(java.lang.String propertyName,
                         java.lang.Object value)
                  throws GeneralLeanFtException
        Calls the setter of the specified property.
        You can retrieve the list of available native operations for an object using the getMembers method.
        For implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
        Parameters:
        propertyName - the name of the property to set.
        value - the value to pass to the property setter.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • getItem

        <T> T getItem(java.lang.Class<T> returnType,
                      int index)
               throws GeneralLeanFtException
        Calls the index getter with the specified index and casts the return value to the specified returnType.
        Type Parameters:
        T - the type of the expected return value.
        Parameters:
        returnType - the expected value type of the return value.
        index - the index to get.
        Returns:
        the return value of the called index, cast to the specified returnType.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • getItem

        <T> T getItem(java.lang.Class<T> returnType,
                      int[] indexes)
               throws GeneralLeanFtException
        Calls the index getter with the specified indexes (for multidimensional indexers) and casts the return value to the specified returnType.
        Type Parameters:
        T - the type of the expected return value.
        Parameters:
        returnType - the expected value type of the return value.
        indexes - an array of index describing the multidimensional index of the item to get.
        Returns:
        the return value of the called indexes, cast to the specified returnType.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • setItem

        void setItem(int index,
                     java.lang.Object value)
              throws GeneralLeanFtException
        Calls the index setter with the specified index value.
        Parameters:
        index - the index to set.
        value - the value to pass to the index setter.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • setItem

        void setItem(int[] indexes,
                     java.lang.Object value)
              throws GeneralLeanFtException
        Calls the indexes (for multidimensional indexers) setter with the specified index value.
        Parameters:
        indexes - the indexes to set.
        value - the value to pass to the indexes setter.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.
      • getMembers

        java.util.List<java.lang.String> getMembers()
                                             throws GeneralLeanFtException
        Returns the list of available native operations for an application object.
        In some technologies and browsers, the names of the method parameters are included and properties without a setter include a [ReadOnly] suffix.
        For additional implementation details and important considerations, see the NativeObject property topic in the UFT Developer Help Center.
        Returns:
        a list providing information regarding the members of the Native Object.
        Throws:
        GeneralLeanFtException - if an error occurs during execution.