Tabnine Logo
PlasticMethod.changeImplementation
Code IndexAdd Tabnine to your IDE (free)

How to use
changeImplementation
method
in
org.apache.tapestry5.plastic.PlasticMethod

Best Java code snippets using org.apache.tapestry5.plastic.PlasticMethod.changeImplementation (Showing top 20 results out of 315)

origin: apache/tapestry-5

private void bridgeServiceMethodToFilterMethod(PlasticMethod method, final PlasticField filterField,
                        final PlasticField nextField, final int position, MethodSignature ms, final MethodSignature fms)
{
  method.changeImplementation(new InstructionBuilderCallback()
  {
    @Override
    public void doBuild(InstructionBuilder builder)
    {
      builder.loadThis().getField(filterField);
      int argumentIndex = 0;
      for (int i = 0; i < fms.getParameterTypes().length; i++)
      {
        if (i == position)
        {
          builder.loadThis().getField(nextField);
        } else
        {
          builder.loadArgument(argumentIndex++);
        }
      }
      builder.invoke(fms.getMethod()).returnResult();
    }
  });
}
origin: org.apache.tapestry/tapestry-ioc

private void bridgeServiceMethodToFilterMethod(PlasticMethod method, final PlasticField filterField,
                        final PlasticField nextField, final int position, MethodSignature ms, final MethodSignature fms)
{
  method.changeImplementation(new InstructionBuilderCallback()
  {
    @Override
    public void doBuild(InstructionBuilder builder)
    {
      builder.loadThis().getField(filterField);
      int argumentIndex = 0;
      for (int i = 0; i < fms.getParameterTypes().length; i++)
      {
        if (i == position)
        {
          builder.loadThis().getField(nextField);
        } else
        {
          builder.loadArgument(argumentIndex++);
        }
      }
      builder.invoke(fms.getMethod()).returnResult();
    }
  });
}
origin: apache/tapestry-5

public void implementNoOpMethod(MethodDescription method, String format, Object... arguments)
{
  final String message = String.format(format, arguments);
  plasticClass.introduceMethod(method).changeImplementation(new InstructionBuilderCallback()
  {
    public void doBuild(InstructionBuilder builder)
    {
      builder.throwException(RuntimeException.class, message);
    }
  });
}
origin: apache/tapestry-5

@Override
public PlasticMethod introduceMethod(MethodDescription description, InstructionBuilderCallback callback)
{
  check();
  // TODO: optimize this so that a default implementation is not created.
  return introduceMethod(description).changeImplementation(callback);
}
origin: org.apache.tapestry/plastic

@Override
public PlasticMethod introduceMethod(MethodDescription description, InstructionBuilderCallback callback)
{
  check();
  // TODO: optimize this so that a default implementation is not created.
  return introduceMethod(description).changeImplementation(callback);
}
origin: apache/tapestry-5

private void implementDispatchMethod(final PlasticClass plasticClass, final boolean isRoot, final MutableComponentModel model, final Flow<EventHandlerMethod> eventHandlerMethods)
  plasticClass.introduceMethod(TransformConstants.DISPATCH_COMPONENT_EVENT_DESCRIPTION).changeImplementation(new InstructionBuilderCallback()
origin: org.apache.tapestry/tapestry-ioc

private void implementMethod(PlasticClass plasticClass, final Method method, final PlasticField commandsField)
  plasticClass.introduceMethod(method).changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

private void implementMethod(PlasticClass plasticClass, final Method method, final PlasticField commandsField)
  plasticClass.introduceMethod(method).changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

/**
 * Creates a method that does a conversion from Object to the expected root type, with
 * a null check.
 */
private void implementGetRoot()
{
  getRootMethod = plasticClass.introducePrivateMethod(PlasticUtils.toTypeName(rootType), "getRoot",
      SINGLE_OBJECT_ARGUMENT, null);
  getRootMethod.changeImplementation(new InstructionBuilderCallback()
  {
    public void doBuild(InstructionBuilder builder)
    {
      builder.loadArgument(0).dupe().when(Condition.NULL, new InstructionBuilderCallback()
      {
        public void doBuild(InstructionBuilder builder)
        {
          builder.throwException(NullPointerException.class,
              String.format("Root object of property expression '%s' is null.", expression));
        }
      });
      builder.checkcast(rootType).returnResult();
    }
  });
}
origin: org.apache.tapestry/tapestry-ioc

method.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

method.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

delegateMethod.changeImplementation(new InstructionBuilderCallback()
origin: org.apache.tapestry/tapestry-ioc

delegateMethod.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

interfaceMethod.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

delegateMethod.changeImplementation(new InstructionBuilderCallback()
plasticClass.introduceMethod(WRITE_REPLACE).changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

delegateMethod.changeImplementation(returnCreateObject);
origin: org.apache.tapestry/tapestry-ioc

delegateMethod.changeImplementation(new InstructionBuilderCallback()
plasticClass.introduceMethod(WRITE_REPLACE).changeImplementation(new InstructionBuilderCallback()
origin: org.apache.tapestry/tapestry-ioc

    null, null);
delegateMethod.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

    null, null);
delegateMethod.changeImplementation(new InstructionBuilderCallback()
origin: apache/tapestry-5

    SINGLE_OBJECT_ARGUMENT, null);
navMethod.changeImplementation(new InstructionBuilderCallback()
org.apache.tapestry5.plasticPlasticMethodchangeImplementation

Javadoc

Clears the instructions for this method, and creates a new empty InstructionBuilder so that the implementation of the method can be specified. This may be considered a kind of last resort when no other approach is sufficient. If the method is currently abstract, it will have its abstract flag cleared. If the method has advice, the advice is not lost but will instead wrap around the new method implementation.

Popular methods of PlasticMethod

  • addAdvice
    Adds advice to the method. Adding advice implicitly rewrites the implementation of the method (this
  • delegateTo
    Much like #delegateTo(PlasticField), but the object to delegate to is dynamically computed by anothe
  • getDescription
    Returns a representation of the method's name, return value, argument types, etc.
  • getAnnotation
  • getPlasticClass
    Returns the PlasticClass containing this method.
  • hasAnnotation
  • getMethodIdentifier
    Returns a short identifier for the method that includes the class name, the method name, and the typ
  • isVoid
    Returns true if this method is type void.
  • getHandle
    Returns a handle that can be used to invoke a method of a transformed class instance.
  • getParameters
    Returns access to the parameters of the method and, in particular, the visible annotations on those
  • isOverride
    Returns true if the method is an override of a method from the parent class.
  • isOverride

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • From CI to AI: The AI layer in your organization
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