Package com.gwtent.reflection.client

Examples of com.gwtent.reflection.client.Parameter


  /* (non-Javadoc)
   * @see com.gwtent.client.reflection.AbstractMethod#findParameter(java.lang.String)
   */
  public Parameter findParameter(String name) {
    Iterator iterator = params.iterator();
    Parameter param = null;
    while (iterator.hasNext()) {
      param = (Parameter) iterator.next();
      if (param.getName().equals(name)) {
        return param;
      }
    }
    return null;
  }
View Full Code Here


  protected void toStringParamsAndThrows(StringBuffer sb) {
    sb.append("(");
    boolean needComma = false;
    for (int i = 0, c = params.size(); i < c; ++i) {
      Parameter param = (Parameter) params.get(i);
      if (needComma) {
        sb.append(", ");
      } else {
        needComma = true;
      }
      if ((isVarArgs() && i == c - 1) && (param.getType() != null)) {
        ArrayType arrayType = param.getType().isArray();
        assert (arrayType != null);
        sb.append(arrayType.getComponentType().getParameterizedQualifiedSourceName());
        sb.append("...");
      } else {
        sb.append(param.getTypeName());
      }
      sb.append(" ");
      sb.append(param.getName());
    }
    sb.append(")");

    if (!thrownTypes.isEmpty()) {
      sb.append(" throws ");
View Full Code Here

    if (params.size() != paramTypes.length) {
      return false;
    }

    for (int i = 0; i < paramTypes.length; i++) {
      Parameter candidate = (Parameter) params.get(i);
      // Identity tests are ok since identity is durable within an oracle.
      //
      if (candidate.getType() != paramTypes[i]) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

    if (params.size() != paramTypes.length) {
      return false;
    }

    for (int i = 0; i < paramTypes.length; i++) {
      Parameter candidate = (Parameter) params.get(i);
      // Identity tests are ok since identity is durable within an oracle.
      //
      if (!candidate.getTypeName().equals(paramTypes[i])) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

  public Object[] createArgs(MethodInvocation invocation, Method method,
      Object returnValue, Throwable throwingValue) {
    Parameter[] params = method.getParameters();
    Object[] result = new Object[params.length];
    for (int i = 0; i < params.length; i++) {
      Parameter param = params[i];
     
      if (onlyOneByType(params, param)){
        result[i] = getArgByType_OnlyOne(invocation, param.getTypeName());
      }
    }
   
    int paramIndex = this.getReturningParamIndex(method);
    if (paramIndex >= 0)
View Full Code Here

    StringBuffer sb = new StringBuffer();
    sb.setLength(0);
    sb.append(method.getName());
    Parameter[] params = method.getParameters();
    for (int j = 0; j < params.length; j++) {
      Parameter param = params[j];
      sb.append("/");
      sb.append(param.getType().getQualifiedSourceName());
    }
    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of com.gwtent.reflection.client.Parameter

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.