Beispiel #1
0
  public String toString() {
    String asString = (_code != null) ? "Error code: " + _code + "; " : "Successful result; ";

    // Add all parameters
    asString += PropertyReaderUtils.toString(_parameters, "no parameters") + "; ";

    // Data section
    if (_dataElement == null) {
      asString += "no data section";
    } else {
      asString += _dataElement.toString();
    }

    return asString;
  }
Beispiel #2
0
  /**
   * Creates a new <code>FunctionRequest</code>, optionally indicating that the actual function
   * invocation should be skipped.
   *
   * @param functionName the name of the function, cannot be <code>null</code>.
   * @param parameters the parameters of the function requested, or <code>null</code>.
   * @param dataElement the data section of the input request, or <code>null</code>.
   * @param skipFunctionCall <code>true</code> if the function should not be executed; <code>false
   *     </code> if the function should be executed (the latter being typical)
   * @throws IllegalArgumentException if <code>functionName == null</code>.
   * @since XINS 2.0
   */
  public FunctionRequest(
      String functionName, PropertyReader parameters, Element dataElement, boolean skipFunctionCall)
      throws IllegalArgumentException {

    // Check preconditions
    MandatoryArgumentChecker.check("functionName", functionName);

    // Initialize instance fields
    _functionName = functionName;
    _parameters =
        (parameters == null)
            ? PropertyReaderUtils.EMPTY_PROPERTY_READER
            : PropertyReaderUtils.copyUnmodifiable(parameters);
    _dataElement = dataElement;
    _skipFunctionCall = skipFunctionCall;
  }