Tabnine Logo
Binder.invokeVirtual
Code IndexAdd Tabnine to your IDE (free)

How to use
invokeVirtual
method
in
com.headius.invokebinder.Binder

Best Java code snippets using com.headius.invokebinder.Binder.invokeVirtual (Showing top 10 results out of 315)

origin: com.headius/invokebinder

/**
 * Terminate this binder by looking up the named virtual method on the
 * first argument's type. Perform the actual method lookup using the given
 * Lookup object.
 *
 * @param lookup the Lookup to use for handle lookups
 * @param name   the name of the target virtual method
 * @return a SmartHandle with this binder's starting signature, bound
 * to the target method
 * @throws NoSuchMethodException  if the named method with current signature's types does not exist
 * @throws IllegalAccessException if the named method is not accessible to the given Lookup
 */
public SmartHandle invokeVirtual(Lookup lookup, String name) throws NoSuchMethodException, IllegalAccessException {
  return new SmartHandle(start, binder.invokeVirtual(lookup, name));
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

.invokeVirtual(MethodHandles.lookup(), "call");
origin: com.headius/invokebinder

/**
 * Apply the chain of transforms and bind them to a virtual method specified
 * using the end signature plus the given class and name. The method will
 * be retrieved using the given Lookup and must match the end signature
 * exactly.
 *
 * If the final handle's type does not exactly match the initial type for
 * this Binder, an additional cast will be attempted.
 *
 * This version is "quiet" in that it throws an unchecked InvalidTransformException
 * if the target method does not exist or is inaccessible.
 *
 * @param lookup the MethodHandles.Lookup to use to look up the method
 * @param name   the name of the method to invoke
 * @return the full handle chain, bound to the given method
 */
public MethodHandle invokeVirtualQuiet(MethodHandles.Lookup lookup, String name) {
  try {
    return invokeVirtual(lookup, name);
  } catch (IllegalAccessException | NoSuchMethodException e) {
    throw new InvalidTransformException(e);
  }
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.invokeVirtual(MethodHandles.lookup(), "call");
origin: org.projectodd.rephract/rephract

public MethodHandle getBootstrapMethodHandle() throws NoSuchMethodException, IllegalAccessException {
  Lookup lookup = MethodHandles.lookup();
  return Binder.from(CallSite.class, Lookup.class, String.class, MethodType.class)
      .insert(0, this)
      .invokeVirtual(lookup, "bootstrap");
}
origin: org.projectodd.rephract/rephract

protected void addArrayCoercion(int distance, Class<?> toType, Class<?> fromType, ArrayCoercer arrayCoercer) throws IllegalAccessException, NoSuchMethodException {
  Lookup lookup = MethodHandles.lookup();
  String coerceMethod = "coerceToObjectInternal";
  if (toType.equals(boolean[].class)) {
    coerceMethod = "coerceToBoolean";
  } else if (toType.equals(byte[].class)) {
    coerceMethod = "coerceToByte";
  } else if (toType.equals(char[].class)) {
    coerceMethod = "coerceToChar";
  } else if (toType.equals(double[].class)) {
    coerceMethod = "coerceToDouble";
  } else if (toType.equals(float[].class)) {
    coerceMethod = "coerceToFloat";
  } else if (toType.equals(int[].class)) {
    coerceMethod = "coerceToInt";
  } else if (toType.equals(long[].class)) {
    coerceMethod = "coerceToLong";
  } else if (toType.equals(short[].class)) {
    coerceMethod = "coerceToShort";
  }
  MethodHandle filter = Binder.from(toType, Object.class)
      .insert(0, arrayCoercer)
      .invokeVirtual(lookup, coerceMethod);
  this.arrayCoercions.add(new ArrayCoercionEntry(distance, filter, fromType, toType, arrayCoercer));
}
origin: org.jruby/jruby-complete

public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, int unwrap) throws Throwable {
  YieldSite site = new YieldSite(type, unwrap == 1 ? true : false);
  MethodHandle handle;
  switch (name) {
    case "yield":
    case "yieldSpecific":
      handle = Binder.from(type)
          .prepend(YieldSite.class, site)
          .invokeVirtual(lookup, name);
      break;
    case "yieldValues":
      handle = Binder.from(type)
          .collect(2, IRubyObject[].class)
          .prepend(YieldSite.class, site)
          .invokeVirtual(lookup, name);
      break;
    default:
      throw new RuntimeException("invalid yield type: " + name);
  }
  site.setTarget(handle);
  return site;
}
origin: org.jruby/jruby-core

public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, int unwrap) throws Throwable {
  YieldSite site = new YieldSite(type, unwrap == 1 ? true : false);
  MethodHandle handle;
  switch (name) {
    case "yield":
    case "yieldSpecific":
      handle = Binder.from(type)
          .prepend(YieldSite.class, site)
          .invokeVirtual(lookup, name);
      break;
    case "yieldValues":
      handle = Binder.from(type)
          .collect(2, IRubyObject[].class)
          .prepend(YieldSite.class, site)
          .invokeVirtual(lookup, name);
      break;
    default:
      throw new RuntimeException("invalid yield type: " + name);
  }
  site.setTarget(handle);
  return site;
}
origin: org.jruby/jruby-complete

.permute(2)
.append(index)
.invokeVirtual(LOOKUP, "get");
.permute(2, 3)
.append(index)
.invokeVirtual(LOOKUP, "set");
origin: org.jruby/jruby-core

.permute(2)
.append(index)
.invokeVirtual(LOOKUP, "get");
.permute(2, 3)
.append(index)
.invokeVirtual(LOOKUP, "set");
com.headius.invokebinderBinderinvokeVirtual

Javadoc

Apply the chain of transforms and bind them to a virtual method specified using the end signature plus the given class and name. The method will be retrieved using the given Lookup and must match the end signature exactly. If the final handle's type does not exactly match the initial type for this Binder, an additional cast will be attempted.

Popular methods of Binder

  • from
    Construct a new Binder, starting from a given MethodType.
  • insert
    Insert at the given index the given argument value(s).
  • invoke
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • collect
    Box all incoming arguments from the given position onward into the given array type.
  • constant
    Apply the tranforms, binding them to a constant value that will propagate back through the chain. Th
  • drop
    Drop from the given index a number of arguments.
  • filter
    Filter incoming arguments, from the given index, replacing each with the result of calling the assoc
  • fold
    Process the incoming arguments using the given handle, inserting the result as the first argument.
  • permute
    Permute the incoming arguments to a new sequence specified by the given values. Arguments may be dup
  • cast
    Cast the incoming arguments to the given MethodType. The casts applied are equivalent to those in Me
  • filterReturn
    Filter return value, using a function that produces the current return type from another type. The n
  • invokeStaticQuiet
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • filterReturn,
  • invokeStaticQuiet,
  • invokeVirtualQuiet,
  • tryFinally,
  • nop,
  • type,
  • append,
  • foldVoid,
  • identity

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now