Class BlockInjectionProvider

  extended by
All Implemented Interfaces:

public class BlockInjectionProvider
extends Object
implements InjectionProvider2

Identifies fields of type Block that have the Inject annotation and converts them into read-only fields containing the injected Block from the template. The annotation's value is the id of the block to inject; if omitted, the block id is deduced from the field id.

Must be scheduled before DefaultInjectionProvider because it uses the same annotation, Inject, with a different interpretation.

Constructor Summary
Method Summary
 boolean provideInjection(PlasticField field, ObjectLocator locator, MutableComponentModel componentModel)
          Perform the injection, if possible.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public BlockInjectionProvider()
Method Detail


public boolean provideInjection(PlasticField field,
                                ObjectLocator locator,
                                MutableComponentModel componentModel)
Description copied from interface: InjectionProvider2
Perform the injection, if possible. Most often, this will result in a call to PlasticField.inject(Object). The caller is responsible for invoking PlasticField.claim(Object).

Specified by:
provideInjection in interface InjectionProvider2
field - that has the Inject annotation
locator - allows services to be located
componentModel - defines the relevant aspects of the component
true if an injection has been made (terminates the command chain), false to continue down the chain

Copyright © 2003-2012 The Apache Software Foundation.