Codota Logo
PetiteRegistry$BeanRegister
Code IndexAdd Codota to your IDE (free)

How to use
PetiteRegistry$BeanRegister
in
jodd.petite

Best Java code snippets using jodd.petite.PetiteRegistry$BeanRegister (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: oblac/jodd

/**
 * Starts with bean registration. Example:
 * <code>bean(Foo.class).name("").scope(...).wiringMode(...).define().register();</code>
 *
 * @see PetiteBeans#registerPetiteBean(Class, String, Class, WiringMode, boolean, Consumer)
 */
public BeanRegister bean(final Class beanType) {
  return new BeanRegister(beanType);
}
origin: oblac/jodd

@Test
void testManualDefinitionUsingAnnotations2() {
  PetiteContainer pc = new PetiteContainer();
  PetiteRegistry.of(pc).bean(SomeService.class).register();
  PetiteRegistry.of(pc).bean(PojoAnnBean.class).name("pojo").define().register();
  assertEquals(2, pc.beansCount());
  PojoAnnBean pojoBean = pc.getBean("pojo");
  SomeService ss = pc.getBean("someService");
  assertNotNull(pojoBean);
  assertNotNull(ss);
  assertSame(ss, pojoBean.fservice);
  assertNull(pojoBean.service);
  assertNull(pojoBean.service2);
  assertEquals(0, pojoBean.count);
}
origin: oblac/jodd

  @Test
  void testWiringMethodArguments() {
    PetiteContainer pc = new PetiteContainer();

    pc.config().setDefaultWiringMode(WiringMode.OPTIONAL);

    PetiteRegistry petiteRegistry = pc.createContainerRegistry();

    petiteRegistry.bean(DaDrum.class).register();
    petiteRegistry.bean(Guitar.class).register();
    petiteRegistry.bean(TheBand.class).register();

    TheBand theBand = pc.getBean(TheBand.class);

    assertTrue(theBand.isBandReady());
  }
}
origin: oblac/jodd

@Test
void testManualRegistrationUsingAnnotations2() {
  PetiteContainer pc = new PetiteContainer();
  PetiteRegistry.of(pc).bean(SomeService.class).register();
  PetiteRegistry.of(pc).bean(PojoAnnBean.class).name("pojo").register();
  assertEquals(2, pc.beansCount());
  PojoAnnBean pojoBean = pc.getBean("pojo");
  SomeService ss = pc.getBean("someService");
  assertNotNull(pojoBean);
  assertNotNull(ss);
  assertSame(ss, pojoBean.fservice);
  assertSame(ss, pojoBean.service);
  assertSame(ss, pojoBean.service2);
  assertEquals(1, pojoBean.count);
}
origin: oblac/jodd

@Test
void testManualRegistration2() {
  PetiteContainer pc = new PetiteContainer();
  PetiteRegistry.of(pc).bean(SomeService.class).register();
  PetiteRegistry.of(pc).bean(PojoBean.class).name("pojo").register();
  assertEquals(2, pc.beansCount());
  PetiteRegistry.of(pc).wire("pojo").ctor().bind();
  PetiteRegistry.of(pc).wire("pojo").property("service").ref("someService").bind();
  PetiteRegistry.of(pc).wire("pojo").method("injectService").ref("someService").bind();
  PetiteRegistry.of(pc).init("pojo").invoke(POST_INITIALIZE).methods("init").register();
  PojoBean pojoBean = pc.getBean("pojo");
  SomeService ss = pc.getBean("someService");
  assertNotNull(pojoBean);
  assertNotNull(ss);
  assertSame(ss, pojoBean.fservice);
  assertSame(ss, pojoBean.service);
  assertSame(ss, pojoBean.service2);
  assertEquals(1, pojoBean.count);
}
origin: oblac/jodd

@Test
void testManualDefinition2() {
  PetiteRegistry petiteRegistry = PetiteRegistry.of(new PetiteContainer());
  petiteRegistry.bean(SomeService.class).register();
  petiteRegistry.bean(PojoBean.class).name("pojo").define().register();
  assertEquals(2, petiteRegistry.petiteContainer().beansCount());
  petiteRegistry.wire("pojo").ctor().bind();
  petiteRegistry.wire("pojo").property("service").ref("someService").bind();
  petiteRegistry.wire("pojo").method("injectService").ref("someService").bind();
  petiteRegistry.init("pojo").invoke(POST_INITIALIZE).methods("init").register();
  PojoBean pojoBean = petiteRegistry.petiteContainer().getBean("pojo");
  SomeService ss = petiteRegistry.petiteContainer().getBean("someService");
  assertNotNull(pojoBean);
  assertNotNull(ss);
  assertSame(ss, pojoBean.fservice);
  assertSame(ss, pojoBean.service);
  assertSame(ss, pojoBean.service2);
  assertEquals(1, pojoBean.count);
}
origin: org.jodd/jodd-petite

/**
 * Starts with bean registration. Example:
 * <code>bean(Foo.class).name("").scope(...).wiringMode(...).define().register();</code>
 *
 * @see PetiteBeans#registerPetiteBean(Class, String, Class, WiringMode, boolean, Consumer)
 */
public BeanRegister bean(final Class beanType) {
  return new BeanRegister(beanType);
}
jodd.petitePetiteRegistry$BeanRegister

Most used methods

  • <init>
  • define
    Bean will be defined rather just registered.
  • name
    Defines bean name. If missing, it will be resolved from type name.
  • register
    Registers a bean.

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now