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

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

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

origin: org.apache.tapestry/plastic

@Override
public PlasticClass proxyInterface(Class interfaceType, PlasticMethod method)
{
  check();
  assert method != null;
  introduceInterface(interfaceType);
  // TAP5-2582: avoiding adding/delegating the same method more than once
  Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
  for (MethodSignature methodSignature : map.keySet())
  {
    introduceMethod(map.get(methodSignature)).delegateTo(method);
  }
  
  return this;
}
origin: apache/tapestry-5

@Override
public PlasticClass proxyInterface(Class interfaceType, PlasticMethod method)
{
  check();
  assert method != null;
  introduceInterface(interfaceType);
  // TAP5-2582: avoiding adding/delegating the same method more than once
  Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
  for (MethodSignature methodSignature : map.keySet())
  {
    final MethodDescription description = map.get(methodSignature);
    if(Modifier.isStatic(description.modifiers))
    {
      continue;
    }
    introduceMethod(map.get(methodSignature)).delegateTo(method);
  }
  return this;
}
origin: apache/tapestry-5

@Override
public PlasticClass proxyInterface(Class interfaceType, PlasticField field)
{
  check();
  assert field != null;
  introduceInterface(interfaceType);
  // TAP5-2582: avoiding adding/delegating the same method more than once
  Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
  for (MethodSignature methodSignature : map.keySet())
  {
    final MethodDescription description = map.get(methodSignature);
    if(Modifier.isStatic(description.modifiers))
    {
      continue;
    }
    introduceMethod(description).delegateTo(field);
  }
  return this;
}
origin: org.apache.tapestry/plastic

  @Override
  public PlasticClass proxyInterface(Class interfaceType, PlasticField field)
  {
    check();

    assert field != null;

    introduceInterface(interfaceType);

    // TAP5-2582: avoiding adding/delegating the same method more than once
//        for (Method m : interfaceType.getMethods())
//        {
//            introduceMethod(m).delegateTo(field);
//        }
    
    Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
    for (MethodSignature methodSignature : map.keySet())
    {
      introduceMethod(map.get(methodSignature)).delegateTo(field);
    }
    
    return this;
  }
  
origin: apache/tapestry-5

  public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
  {
    // Subclasses don't need to bother, they'll inherit from super-classes.

    if (!support.isRootTransformation())
    {
      return;
    }

    plasticClass.introduceInterface(RenderCommand.class);

    PlasticField resourcesField = plasticClass.introduceField(InternalComponentResources.class, "resources").injectFromInstanceContext();

    plasticClass.introduceMethod(RENDER_DESCRIPTION).delegateTo(resourcesField);

    plasticClass.introduceMethod(TransformConstants.POST_RENDER_CLEANUP_DESCRIPTION).delegateTo(resourcesField);
  }
}
origin: apache/tapestry-5

  public void transform(PlasticClass plasticClass)
  {
    PlasticMethod delegateMethod = plasticClass.introducePrivateMethod(
        PlasticUtils.toTypeName(serviceType), "delegate", null, null);
    delegateMethod.addAdvice(new MethodAdvice()
    {
      public void advise(MethodInvocation invocation)
      {
        invocation.setReturnValue(environment.peekRequired(serviceType));
      }
    });
    for (Method method : serviceType.getMethods())
    {
      plasticClass.introduceMethod(method).delegateTo(delegateMethod);
    }
    plasticClass.addToString(String.format("<EnvironmentalProxy for %s>", serviceType.getName()));
  }
});
origin: org.apache.tapestry/tapestry-ioc

public AspectInterceptorBuilderImpl(AnnotationAccess annotationAccess, PlasticProxyFactory plasticProxyFactory,
                  Class<T> serviceInterface, T delegate, String description)
{
  super(annotationAccess);
  this.serviceInterface = serviceInterface;
  final Class<? extends Object> delegateType = delegate.getClass();
  transformation = plasticProxyFactory.createProxyTransformation(serviceInterface, (Class<? extends T>) delegateType);
  plasticClass = transformation.getPlasticClass();
  plasticClass.addToString(description);
  allMethods.addAll(Arrays.asList(serviceInterface.getMethods()));
  final PlasticField delegateField = plasticClass.introduceField(serviceInterface, "delegate").inject(delegate);
  for (Method method : allMethods)
  {
    plasticClass.introduceMethod(method).delegateTo(delegateField);
  }
  
  // TAP5-2235
  final String delegateTypeName = delegateType.getName();
  MethodDescription getDelegateMethodDescription = 
      new MethodDescription(delegateTypeName, PlasticProxyFactoryImpl.INTERNAL_GET_DELEGATE);
  plasticClass.introduceMethod(getDelegateMethodDescription, new InstructionBuilderCallback()
  {
    @Override
    public void doBuild(InstructionBuilder builder)
    {
      builder.loadThis().getField(delegateField);
      builder.checkcast(delegateType).returnResult();
    }
  });
}
origin: apache/tapestry-5

public AspectInterceptorBuilderImpl(AnnotationAccess annotationAccess, PlasticProxyFactory plasticProxyFactory,
                  Class<T> serviceInterface, T delegate, String description)
{
  super(annotationAccess);
  this.serviceInterface = serviceInterface;
  final Class<? extends Object> delegateType = delegate.getClass();
  transformation = plasticProxyFactory.createProxyTransformation(serviceInterface, (Class<? extends T>) delegateType);
  plasticClass = transformation.getPlasticClass();
  plasticClass.addToString(description);
  allMethods.addAll(Arrays.asList(serviceInterface.getMethods()));
  final PlasticField delegateField = plasticClass.introduceField(serviceInterface, "delegate").inject(delegate);
  for (Method method : allMethods)
  {
    plasticClass.introduceMethod(method).delegateTo(delegateField);
  }
  
  // TAP5-2235
  final String delegateTypeName = delegateType.getName();
  MethodDescription getDelegateMethodDescription = 
      new MethodDescription(delegateTypeName, PlasticProxyFactoryImpl.INTERNAL_GET_DELEGATE);
  plasticClass.introduceMethod(getDelegateMethodDescription, new InstructionBuilderCallback()
  {
    @Override
    public void doBuild(InstructionBuilder builder)
    {
      builder.loadThis().getField(delegateField);
      builder.checkcast(delegateType).returnResult();
    }
  });
}
origin: org.apache.tapestry/tapestry-ioc

plasticClass.introduceMethod(m).delegateTo(delegateMethod);
origin: apache/tapestry-5

plasticClass.introduceMethod(m).delegateTo(delegateMethod);
origin: apache/tapestry-5

plasticClass.introduceMethod(method).delegateTo(delegateMethod);
origin: org.apache.tapestry/tapestry-ioc

plasticClass.introduceMethod(method).delegateTo(delegateMethod);
origin: apache/tapestry-5

plasticClass.introduceMethod(method).delegateTo(delegateMethod);
origin: apache/tapestry-5

    "annotationProvider").inject(annotationProvider);
plasticClass.introduceMethod(ConduitMethods.GET_ANNOTATION).delegateTo(annotationProviderField);
org.apache.tapestry5.plasticPlasticMethoddelegateTo

Javadoc

Changes the implementation of the method to delegate to the provided field. The field must implement the correct interface (or extend the correct class). The original implementation of the method is lost, though (as with #changeImplementation(InstructionBuilderCallback)), method advice is retained.

Popular methods of PlasticMethod

  • addAdvice
    Adds advice to the method. Adding advice implicitly rewrites the implementation of the method (this
  • changeImplementation
    Clears the instructions for this method, and creates a new empty InstructionBuilder so that the impl
  • 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

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JButton (javax.swing)
  • JLabel (javax.swing)
  • Top Vim 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