Examples of MethodAccessor


Examples of com.comphenix.protocol.reflect.accessors.MethodAccessor

      return null;
   
    // We will have to do this dynamically, unfortunately
    try {
      Class<?> clazz = nmsObject.getClass();
      MethodAccessor accessor = getBukkitEntityCache.get(clazz);
     
      if (accessor == null) {
        MethodAccessor created = Accessors.getMethodAccessor(clazz, "getBukkitEntity");
        accessor = getBukkitEntityCache.putIfAbsent(clazz, created);
       
        // We won the race
        if (accessor == null) {
          accessor = created;
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

   */
  private Object instancePara(Parse cells) throws Exception {
    if (this.parsePropertyMethodName != null) {
      String text = cells.text();
      try {
        MethodAccessor methodAccessor = new MethodAccessor<Object>(this, parsePropertyMethodName, String.class);
        return methodAccessor.invoke(this, new Object[] { text });
      } catch (NoSuchMethodRuntimeException e) {
        TypeAdapter typeAdapter = TypeAdapter.on(this, dtoClazz);
        return typeAdapter.parse(text);
      }
    }
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

      this.typeAdapter = TypeAdapter.on(DtoPropertyFixture.this, fieldAccessor.getFieldType());
    }

    public void setValue(Object obj, String value) throws Exception {
      try {
        MethodAccessor methodAccessor = new MethodAccessor<Object>(obj, parseMethodName, String.class);
        methodAccessor.invoke(obj, new Object[] { value });
      } catch (NoSuchMethodRuntimeException e) {
        Object _value = typeAdapter.parse(value);
        fieldAccessor.set(obj, _value);
      }
    }
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

    if (target == null) {
      throw new RuntimeException("the target object can't be null!");
    }
    Object _target = ClazzHelper.getProxiedObject(target);
    Class[] paraClazes = MethodHelper.getParameterClazz(paras);
    MethodAccessor methodAccessor = new MethodAccessor(clazz, method, paraClazes);
    Object result = methodAccessor.invokeUnThrow(_target, paras);
    return (T) result;
  }
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

   * @return
   * @throws Exception
   */
  public static <T> T invoke(Object target, String method, Object... paras) throws Exception {
    Class[] paraClazes = getParameterClazz(paras);
    MethodAccessor accessor = new MethodAccessor(target, method, paraClazes);
    Object result = accessor.invoke(target, paras);
    return (T) result;
  }
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

    return (T) result;
  }

  public static <T> T invokeUnThrow(Object target, String method, Object... paras) {
    Class[] paraClazes = getParameterClazz(paras);
    MethodAccessor accessor = new MethodAccessor(target, method, paraClazes);
    Object result = accessor.invokeUnThrow(target, paras);
    return (T) result;
  }
View Full Code Here

Examples of org.jtester.bytecode.reflector.MethodAccessor

    if (paras != null) {
      for (Object para : paras) {
        paraClazz.add(para == null ? null : para.getClass());
      }
    }
    MethodAccessor accessor = new MethodAccessor(targetClass, method, paraClazz.toArray(new Class[0]));
    return (T) accessor.invokeStaticUnThrow(paras);
  }
View Full Code Here

Examples of org.modelmapper.internal.PropertyInfoImpl.MethodAccessor

  static synchronized Accessor accessorFor(Class<?> type, Method method,
      Configuration configuration, String name) {
    Integer hashCode = hashCodeFor(type, method.getName(), configuration);
    Accessor accessor = (Accessor) cache.get(hashCode);
    if (accessor == null) {
      accessor = new MethodAccessor(type, method, name);
      cache.put(hashCode, accessor);
    }

    return accessor;
  }
View Full Code Here

Examples of org.mvel2.optimizers.impl.refl.nodes.MethodAccessor

        if (accessorNode instanceof GetterAccessor) {
            return new MethodInvocation(((GetterAccessor)accessorNode).getMethod(), conditionClass);
        }

        if (accessorNode instanceof MethodAccessor) {
            MethodAccessor methodAccessor = (MethodAccessor)accessorNode;
            Method method = methodAccessor.getMethod();
            MethodInvocation invocation = new MethodInvocation(method);
            boolean isVarArgs = method.isVarArgs();
            readInvocationParams(invocation, methodAccessor.getParms(), methodAccessor.getParameterTypes(), isVarArgs);
            return invocation;
        }

        if (accessorNode instanceof ConstructorAccessor) {
            ConstructorAccessor constructorAccessor = (ConstructorAccessor)accessorNode;
View Full Code Here

Examples of org.mvel2.optimizers.impl.refl.nodes.MethodAccessor

        if (accessorNode instanceof GetterAccessor) {
            return new MethodInvocation(((GetterAccessor)accessorNode).getMethod());
        }

        if (accessorNode instanceof MethodAccessor) {
            MethodAccessor methodAccessor = (MethodAccessor)accessorNode;
            Method method = methodAccessor.getMethod();
            MethodInvocation invocation = new MethodInvocation(method);
            boolean isVarArgs = method.isVarArgs();
            readInvocationParams(invocation, methodAccessor.getParms(), methodAccessor.getParameterTypes(), isVarArgs);
            return invocation;
        }

        if (accessorNode instanceof ConstructorAccessor) {
            ConstructorAccessor constructorAccessor = (ConstructorAccessor)accessorNode;
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.