We need you!

Icon

The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  • Add component to the container
  • Get component from the container
Code Block
borderStylesolid
titleCompilerContainer.java
borderStylesolid
pico = new PicoBuilder().withConstructorInjection().withCaching().build();
pico.addComponent(CliAnalyzer.class);
CliAnalyzer cliAnalyzer = pico.getComponent(CliAnalyzer.class);

...

For example, given the following class :

Code Block
borderStylesolid
titleAClass.java
borderStylesolid
public class AClass {
 public AClass(CliAnalyzer cliAnalyzer){
  // Use cliAnalyzer
 }
}
Code Block
borderStylesolid
titleCompilerContainer.java
borderStylesolid
pico = new PicoBuilder().withConstructorInjection().withCaching().build();
pico.addComponent(CliAnalyzer.class);
pico.addComponent(AClass.class);
AClass aClass = pico.getComponent(AClass.class);

...