Package com.jacob.com

Examples of com.jacob.com.Variant


   * @param actionCommand
   * @param parameter
   * @return Variant result
   */
  public Variant invoke(String actionCommand, boolean parameter) {
    return Dispatch.call(this, actionCommand, new Variant(parameter));
  }
View Full Code Here


   * @param actionCommand
   * @param parameter
   * @return Variant result of the invoke (Dispatch.call)
   */
  public Variant invoke(String actionCommand, int parameter) {
    return Dispatch.call(this, actionCommand, new Variant(parameter));
  }
View Full Code Here

   * @param parameter2
   * @return Variant result
   */
  public Variant invoke(String actionCommand, String parameter1,
      int parameter2) {
    return Dispatch.call(this, actionCommand, parameter1, new Variant(
        parameter2));
  }
View Full Code Here

   * @param parameter1
   * @param parameter2
   * @return a Variant but that may be null for some calls
   */
  public Variant invoke(String actionCommand, int parameter1, int parameter2) {
    return Dispatch.call(this, actionCommand, new Variant(parameter1),
        new Variant(parameter2));
  }
View Full Code Here

   * @see com.jacob.com.InvocationProxy#invoke(java.lang.String,
   *      com.jacob.com.Variant[])
   */
  @SuppressWarnings("unchecked")
  public Variant invoke(String methodName, Variant targetParameters[]) {
    Variant mVariantToBeReturned = null;
    if (mTargetObject == null) {
      // structured programming guidlines say this return should not be up
      // here
      return null;
    }
    Class targetClass = mTargetObject.getClass();
    if (methodName == null) {
      throw new IllegalArgumentException(
          "InvocationProxy: missing method name");
    }
    if (targetParameters == null) {
      throw new IllegalArgumentException(
          "InvocationProxy: missing Variant parameters");
    }
    try {
      Method targetMethod;
      Object parametersAsJavaObjects[] = getParametersAsJavaObjects(targetParameters);
      Class parametersAsJavaClasses[] = getParametersAsJavaClasses(parametersAsJavaObjects);
      targetMethod = targetClass.getMethod(methodName,
          parametersAsJavaClasses);
      if (targetMethod != null) {
        // protected classes can't be invoked against even if they
        // let you grab the method. you could do
        // targetMethod.setAccessible(true);
        // but that should be stopped by the security manager
        Object mReturnedByInvocation = null;
        mReturnedByInvocation = targetMethod.invoke(mTargetObject,
            parametersAsJavaObjects);
        if (mReturnedByInvocation == null) {
          mVariantToBeReturned = null;
        } else if (!(mReturnedByInvocation instanceof Variant)) {
          mVariantToBeReturned = new Variant(mReturnedByInvocation);
        } else {
          mVariantToBeReturned = (Variant) mReturnedByInvocation;
        }
      }
    } catch (SecurityException e) {
View Full Code Here

          "This only works with an array of parameters");
    }
    int numParameters = targetParameters.length;
    Object parametersAsJavaObjects[] = new Object[numParameters];
    for (int parameterIndex = 0; parameterIndex < numParameters; parameterIndex++) {
      Variant oneParameterObject = targetParameters[parameterIndex];
      if (oneParameterObject == null) {
        parametersAsJavaObjects[parameterIndex] = null;
      } else {
        try {
          parametersAsJavaObjects[parameterIndex] = oneParameterObject
              .toJavaObject();
        } catch (NotImplementedException nie) {
          throw new IllegalArgumentException(
              "Can't convert parameter " + parameterIndex
                  + " type " + oneParameterObject.getvt()
                  + " to java object: " + nie.getMessage());
        }
      }
    }
    return parametersAsJavaObjects;
View Full Code Here

  public int getCommandTimeout() {
    return Dispatch.get(this, "CommandTimeout").getInt();
  }

  public void setCommandTimeout(int plTimeout) {
    Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
  }
View Full Code Here

  public int getConnectionTimeout() {
    return Dispatch.get(this, "ConnectionTimeout").getInt();
  }

  public void setConnectionTimeout(int plTimeout) {
    Dispatch.put(this, "ConnectionTimeout", new Variant(plTimeout));
  }
View Full Code Here

  }

  // how to deal with RecordsAffected being output?
  public Variant Execute(String CommandText, Variant RecordsAffected,
      int Options) {
    return Dispatch.call(this, CommandText, RecordsAffected, new Variant(
        Options));
  }
View Full Code Here

  }

  public void Open(String ConnectionString, String UserID, String Password,
      int Options) {
    Dispatch.call(this, "Open", ConnectionString, UserID, Password,
        new Variant(Options));
  }
View Full Code Here

TOP

Related Classes of com.jacob.com.Variant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.