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

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

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

origin: org.jruby/jruby-complete

  @Override
  public Binder prepareBinder() {
    return Binder
        .from(type())
        .filterReturn(CACHE.bindTo(this));
  }
}
origin: org.jruby/jruby-core

  @Override
  public Binder prepareBinder() {
    return Binder
        .from(type())
        .filterReturn(CACHE.bindTo(this));
  }
}
origin: com.headius/invokebinder

/**
 * Use the given filter function to transform the return value at this
 * point in the binder. The filter will be inserted into the handle, and
 * return values will pass through it before continuing.
 *
 * The filter's argument must match the expected return value downstream
 * from this point in the binder, and the return value must match the
 * return value at this point in the binder.
 *
 * @param filter the function to use to transform the return value at this point
 * @return a new SmartBinder with the filter applied
 */
public SmartBinder filterReturn(MethodHandle filter) {
  return new SmartBinder(this, signature().changeReturn(filter.type().returnType()), binder.filterReturn(filter));
}
origin: org.jruby/jruby-complete

private static MethodHandle createAttrReaderHandle(InvokeSite site, IRubyObject self, RubyClass cls, VariableAccessor accessor) {
  MethodHandle nativeTarget;
  MethodHandle filter = cls.getClassRuntime().getNullToNilHandle();
  MethodHandle getValue;
  if (accessor instanceof FieldVariableAccessor) {
    MethodHandle getter = ((FieldVariableAccessor)accessor).getGetter();
    getValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(Object.class, self.getClass()))
        .invoke(getter);
  } else {
    getValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(Object.class, Object.class))
        .prepend(accessor)
        .invokeVirtualQuiet(LOOKUP, "get");
  }
  // NOTE: Must not cache the fully-bound handle in the method, since it's specific to this class
  return getValue;
}
origin: org.jruby/jruby-core

private static MethodHandle createAttrReaderHandle(InvokeSite site, IRubyObject self, RubyClass cls, VariableAccessor accessor) {
  MethodHandle nativeTarget;
  MethodHandle filter = cls.getClassRuntime().getNullToNilHandle();
  MethodHandle getValue;
  if (accessor instanceof FieldVariableAccessor) {
    MethodHandle getter = ((FieldVariableAccessor)accessor).getGetter();
    getValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(Object.class, self.getClass()))
        .invoke(getter);
  } else {
    getValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(Object.class, Object.class))
        .prepend(accessor)
        .invokeVirtualQuiet(LOOKUP, "get");
  }
  // NOTE: Must not cache the fully-bound handle in the method, since it's specific to this class
  return getValue;
}
origin: org.jruby/jruby-complete

private static MethodHandle createAttrWriterHandle(InvokeSite site, IRubyObject self, RubyClass cls, VariableAccessor accessor) {
  MethodHandle nativeTarget;
  MethodHandle filter = Binder
      .from(IRubyObject.class, Object.class)
      .drop(0)
      .constant(cls.getRuntime().getNil());
  MethodHandle setValue;
  if (accessor instanceof FieldVariableAccessor) {
    MethodHandle setter = ((FieldVariableAccessor)accessor).getSetter();
    setValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(void.class, self.getClass(), Object.class))
        .invoke(setter);
  } else {
    setValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(void.class, Object.class, Object.class))
        .prepend(accessor)
        .invokeVirtualQuiet(LOOKUP, "set");
  }
  return setValue;
}
origin: org.jruby/jruby-core

private static MethodHandle createAttrWriterHandle(InvokeSite site, IRubyObject self, RubyClass cls, VariableAccessor accessor) {
  MethodHandle nativeTarget;
  MethodHandle filter = Binder
      .from(IRubyObject.class, Object.class)
      .drop(0)
      .constant(cls.getRuntime().getNil());
  MethodHandle setValue;
  if (accessor instanceof FieldVariableAccessor) {
    MethodHandle setter = ((FieldVariableAccessor)accessor).getSetter();
    setValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(void.class, self.getClass(), Object.class))
        .invoke(setter);
  } else {
    setValue = Binder.from(site.type())
        .drop(0, 2)
        .filterReturn(filter)
        .cast(methodType(void.class, Object.class, Object.class))
        .prepend(accessor)
        .invokeVirtualQuiet(LOOKUP, "set");
  }
  return setValue;
}
origin: com.headius/invokebinder

/**
 * Use the given filter function to transform the return value at this
 * point in the binder. The filter will be inserted into the handle, and
 * return values will pass through it before continuing.
 *
 * The filter's argument must match the expected return value downstream
 * from this point in the binder, and the return value must match the
 * return value at this point in the binder.
 *
 * @param filter the function to use to transform the return value at this point
 * @return a new SmartBinder with the filter applied
 */
public SmartBinder filterReturn(SmartHandle filter) {
  return new SmartBinder(this, signature().changeReturn(filter.signature().type().returnType()), binder.filterReturn(filter.handle()));
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

.from(site.type())
.permute(2)
.filterReturn(filter);
.from(site.type())
.permute(2)
.filterReturn(filter)
.insert(1, accessor.getIndex())
.cast(Object.class, RubyBasicObject.class, int.class)
origin: com.ning.billing/killbill-osgi-bundles-jruby

.from(site.type())
.permute(2, 3)
.filterReturn(filter);
.from(site.type())
.permute(2, 3)
.filterReturn(filter)
.insert(1, cls.getRealClass(), accessor.getIndex())
.cast(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class)
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.from(site.type())
.permute(2, 3)
.filterReturn(filter);
.from(site.type())
.permute(2, 3)
.filterReturn(filter)
.insert(1, cls.getRealClass(), accessor.getIndex())
.cast(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class)
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.from(site.type())
.permute(2)
.filterReturn(filter);
.from(site.type())
.permute(2)
.filterReturn(filter)
.insert(1, accessor.getIndex())
.cast(Object.class, RubyBasicObject.class, int.class)
origin: org.jruby/jruby-complete

.permute(2)
.filter(0, receiverConverter)
.filterReturn(filter)
.cast(fieldHandle.type())
.invoke(fieldHandle);
.permute(2, 3)
.filter(0, receiverConverter)
.filterReturn(constant(IRubyObject.class, self.getRuntime().getNil()))
.cast(fieldHandle.type())
.invoke(fieldHandle);
origin: org.jruby/jruby-core

.permute(2)
.filter(0, receiverConverter)
.filterReturn(filter)
.cast(fieldHandle.type())
.invoke(fieldHandle);
.permute(2, 3)
.filter(0, receiverConverter)
.filterReturn(constant(IRubyObject.class, self.getRuntime().getNil()))
.cast(fieldHandle.type())
.invoke(fieldHandle);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

if (nativeReturn != void.class) {
  exBinder = exBinder
      .filterReturn(Binder
          .from(newNativeReturn)
          .constant(nullValue(newNativeReturn)));
    .from(site.type())
    .drop(0, isStatic ? 3 : 2)
    .filterReturn(returnFilter)
    .invoke(nativeTarget);
origin: com.ning.billing/killbill-osgi-bundles-jruby

if (nativeReturn != void.class) {
  exBinder = exBinder
      .filterReturn(Binder
          .from(newNativeReturn)
          .constant(nullValue(newNativeReturn)));
    .from(site.type())
    .drop(0, isStatic ? 3 : 2)
    .filterReturn(returnFilter)
    .invoke(nativeTarget);
origin: org.jruby/jruby-core

if (nativeReturn != void.class) {
  exBinder = exBinder
      .filterReturn(Binder
          .from(newNativeReturn)
          .constant(nullValue(newNativeReturn)));
    .from(site.type())
    .drop(0, isStatic ? 3 : 2)
    .filterReturn(returnFilter)
    .invoke(nativeTarget);
origin: org.jruby/jruby-complete

if (nativeReturn != void.class) {
  exBinder = exBinder
      .filterReturn(Binder
          .from(newNativeReturn)
          .constant(nullValue(newNativeReturn)));
    .from(site.type())
    .drop(0, isStatic ? 3 : 2)
    .filterReturn(returnFilter)
    .invoke(nativeTarget);
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

.filterReturn(resultFilter)
.invoke(nativeInvoker);
origin: com.ning.billing/killbill-osgi-bundles-jruby

.filterReturn(resultFilter)
.invoke(nativeInvoker);
com.headius.invokebinderBinderfilterReturn

Javadoc

Filter return value, using a function that produces the current return type from another type. The new endpoint will have the return value that the filter function accepts as an argument.

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.
  • invokeVirtual
    Apply the chain of transforms and bind them to a virtual method specified using the end signature pl
  • 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
  • invokeStaticQuiet
    Apply the chain of transforms and bind them to a static method specified using the end signature plu
  • cast,
  • invokeStaticQuiet,
  • invokeVirtualQuiet,
  • tryFinally,
  • nop,
  • type,
  • append,
  • foldVoid,
  • identity

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top Sublime Text plugins
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