Examples of ArgumentMatch


Examples of net.sourceforge.javautil.bytecode.api.type.method.IBytecodeMethod.ArgumentMatch

  public IBytecodeMethod findMethod(BytecodeResolutionPool pool, String name, TypeDescriptor... parameters) {
    IBytecodeMethod bm = null;
   
    for (IBytecodeMethod method : this.methods) {
      if (!method.getName().equals(name)) continue;
      ArgumentMatch am = method.compareArguments(pool, parameters);
      if (am == ArgumentMatch.FUNCTIONAL && bm == null) bm = method;
      else if (am == ArgumentMatch.EXACT) { bm = method; break; }
    }
   
    if (bm == null) {
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.type.method.IBytecodeMethod.ArgumentMatch

  @Override public IBytecodeConstructor findConstructor(BytecodeResolutionPool pool, TypeDescriptor... parameters) {
    IBytecodeConstructor c = null;
   
    for (IBytecodeConstructor cc : this.constructors) {
      ArgumentMatch am = cc.compareArguments(pool, parameters);
      if (am == ArgumentMatch.FUNCTIONAL && c == null) c = cc;
      else if (am == ArgumentMatch.EXACT) { c = cc; break; }
    }
   
    return c;
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.type.method.IBytecodeMethod.ArgumentMatch

    public IBytecodeConstructor findConstructor(BytecodeResolutionPool pool, TypeDescriptor... types) {
      ConstructorWrapper cw = null;
     
      for (Constructor constructor : clazz.getConstructors()) {
        ConstructorWrapper wrapper = new ConstructorWrapper(constructor);
        ArgumentMatch am = wrapper.compareArguments(pool, types);
        if (am == ArgumentMatch.FUNCTIONAL && cw == null) cw = wrapper;
        else if (am == ArgumentMatch.EXACT) { cw = wrapper; break; }
      }
     
      return cw;
View Full Code Here

Examples of net.sourceforge.javautil.bytecode.api.type.method.IBytecodeMethod.ArgumentMatch

      }
      catch (ClassNotFoundException e) {}
      catch (NoSuchMethodException e) {}

      Class sc = clazz;
      ArgumentMatch am = null;
      while (sc != null) {
        Method[] methods = sc.isInterface() ? sc.getMethods() : sc.getDeclaredMethods();
        for (Method method : methods) {
          if (!method.getName().equals(name)) continue;
          MethodWrapper wrapper = new MethodWrapper(method);
View Full Code Here

Examples of net.sourceforge.javautil.common.reflection.cache.ClassMethodAbstract.ArgumentMatch

  protected <M extends ClassMethodAbstract> M getClosestMatchInternal (Collection<M> members, Object... arguments) {
    if (members == null) return null;
    M match = null;
    synchronized (members) {
      for (M member : members) {
        ArgumentMatch result = member.compareArguments(arguments);
        if (result == ArgumentMatch.EXACT) return member;
        else if (result == ArgumentMatch.FUNCTIONAL && match == null)
          match = member;
      }
      return match;
View Full Code Here

Examples of net.sourceforge.javautil.common.reflection.cache.ClassMethodAbstract.ArgumentMatch

 
  protected <M extends ClassMethodAbstract> M getClosestMatchInternal (Collection<M> members, Class... arguments) {
    if (members == null) return null;
    M match = null;
    for (M member : members) {
      ArgumentMatch result = member.compareArgumentTypes(arguments);
      if (result == ArgumentMatch.EXACT) return member;
      else if (result == ArgumentMatch.FUNCTIONAL && match == null)
        match = member;
    }
    return match;
View Full Code Here

Examples of org.crsh.cli.impl.invocation.ArgumentMatch

      return this;
    }

    public Test assertArgument(int start, int end, String... expectedValues) {
      assertTrue(argumentMatches.size() > 0);
      ArgumentMatch match = argumentMatches.removeFirst();
      assertEquals(start, match.getStart());
      assertEquals(end, match.getEnd());
      ArrayList<String> values = new ArrayList<String>();
      for (LiteralValue value : match.getValues()) {
        values.add(value.getValue());
      }
      assertEquals(Arrays.asList(expectedValues), values);
      return this;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.