Example usage for java.util Vector toArray

List of usage examples for java.util Vector toArray

Introduction

In this page you can find the example usage for java.util Vector toArray.

Prototype

public synchronized Object[] toArray() 

Source Link

Document

Returns an array containing all of the elements in this Vector in the correct order.

Usage

From source file:axiom.framework.core.Application.java

public Object executeExternal(String method, Vector<String> args) throws Exception {
    Object retval = null;/*from  w  ww .  jav  a2  s .  com*/
    RequestEvaluator ev = null;
    try {
        // check if the properties file has been updated
        updateProperties();
        // get evaluator and invoke
        ev = getEvaluator();
        retval = ev.invokeExternal(method, args.toArray());
    } finally {
        releaseEvaluator(ev);
    }
    return retval;
}

From source file:axiom.framework.core.Application.java

/**
 *  Called to execute a method via XML-RPC, usally by axiom.main.ApplicationManager
 *  which acts as default handler/request dispatcher.
 *///from   w  w  w  .  ja  va  2s .c  om
public Object executeXmlRpc(String method, Vector args) throws Exception {
    xmlrpcCount += 1;

    Object retval = null;
    RequestEvaluator ev = null;

    try {
        // check if the properties file has been updated
        updateProperties();

        // get evaluator and invoke
        ev = getEvaluator();
        retval = ev.invokeXmlRpc(method, args.toArray());
    } finally {
        releaseEvaluator(ev);
    }

    return retval;
}

From source file:org.apache.axis.client.Call.java

/**
 * Convert the list of objects into RPCParam's based on the paramNames,
 * paramXMLTypes and paramModes variables.  If those aren't set then just
 * return what was passed in.//from   w  w  w.  j ava 2s. c  o m
 *
 * @param  params   Array of parameters to pass into the operation/method
 * @return Object[] Array of parameters to pass to invoke()
 */
private Object[] getParamList(Object[] params) {
    int numParams = 0;

    // If we never set-up any names... then just return what was passed in
    //////////////////////////////////////////////////////////////////////
    if (log.isDebugEnabled()) {
        log.debug("operation=" + operation);
        if (operation != null) {
            log.debug("operation.getNumParams()=" + operation.getNumParams());
        }
    }
    if (operation == null || operation.getNumParams() == 0) {
        return (params);
    }

    // Count the number of IN and INOUT params, this needs to match the
    // number of params passed in - if not throw an error
    /////////////////////////////////////////////////////////////////////
    numParams = operation.getNumInParams();

    if (params == null || numParams != params.length) {
        throw new JAXRPCException(Messages.getMessage("parmMismatch00",
                (params == null) ? "no params" : "" + params.length, "" + numParams));
    }

    log.debug("getParamList number of params: " + params.length);

    // All ok - so now produce an array of RPCParams
    //////////////////////////////////////////////////
    Vector result = new Vector();
    int j = 0;
    ArrayList parameters = operation.getParameters();

    for (int i = 0; i < parameters.size(); i++) {
        ParameterDesc param = (ParameterDesc) parameters.get(i);
        if (param.getMode() != ParameterDesc.OUT) {
            QName paramQName = param.getQName();

            // Create an RPCParam if param isn't already an RPCParam.
            RPCParam rpcParam = null;
            Object p = params[j++];
            if (p instanceof RPCParam) {
                rpcParam = (RPCParam) p;
            } else {
                rpcParam = new RPCParam(paramQName.getNamespaceURI(), paramQName.getLocalPart(), p);
            }
            // Attach the ParameterDescription to the RPCParam
            // so that the serializer can use the (javaType, xmlType)
            // information.
            rpcParam.setParamDesc(param);

            // Add the param to the header or vector depending
            // on whether it belongs in the header or body.
            if (param.isInHeader()) {
                addHeader(new RPCHeaderParam(rpcParam));
            } else {
                result.add(rpcParam);
            }
        }
    }
    return (result.toArray());
}

From source file:com.cohort.util.String2.java

public static String toCSVString(Vector v) {
    return toSVString(v.toArray(), ",", false);
}

From source file:com.cohort.util.String2.java

/**
 * Generates a Comma-Space-Separated-Value (CSSV) string.  
 * <p>CHANGED: before 2011-03-06, this didn't do anything special for 
 *   strings with internal commas or quotes. Now it uses toJson for that string.
 *
 * @param v a vector of objects//from  ww w.j  a  va2  s. c  o m
 * @return a CSSV String with the values with ", " after
 *    all but the last value.
 *    Returns null if ar is null.
 *    null elements are represented as "[null]".
 */
public static String toCSSVString(Vector v) {
    return toSVString(v.toArray(), ", ", false);
}