jodd-petite/src/main/java/jodd/petite/PetiteContainer.java
public <T> T getBean(final String name) {

		// Lookup for registered bean definition.
		BeanDefinition def = lookupBeanDefinition(name);

		if (def == null) {

			// try provider
			ProviderDefinition providerDefinition = providers.get(name);

			if (providerDefinition != null) {
				return (T) invokeProvider(providerDefinition);
			}
			return null;
		}

		// Find the bean in its scope
		Object bean = def.scopeLookup();

		if (bean == null) {
			// Create new bean in the scope
			initBeanDefinition(def);
			final BeanData beanData = new BeanData(this, def);
			registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
			bean = beanData.bean();
		}

		return (T) bean;
	}
public <T> T getBean(final String name) {

		// Lookup for registered bean definition.
		BeanDefinition def = lookupBeanDefinition(name);

		if (def == null) {

			// try provider
			ProviderDefinition providerDefinition = providers.get(name);

			if (providerDefinition != null) {
				return (T) invokeProvider(providerDefinition);
			}
			return null;
		}

		// Find the bean in its scope
		Object bean = def.scopeLookup();

		if (bean == null) {
			// Create new bean in the scope
			initBeanDefinition(def);
			final BeanData beanData = new BeanData(this, def);
			registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
			bean = beanData.bean();
		}

		return (T) bean;
	}
public < T > T getBean ( final String name ) { // Lookup for registered bean definition. BeanDefinition def = lookupBeanDefinition ( name ) ; if ( def == null ) { // try provider ProviderDefinition providerDefinition = providers . get ( name ) ; if ( providerDefinition != null ) { return ( T ) invokeProvider ( providerDefinition ) ; } return null ; } // Find the bean in its scope Object bean = def . scopeLookup ( ) ; if ( bean == null ) { // Create new bean in the scope initBeanDefinition ( def ) ; final BeanData beanData = new BeanData ( this , def ) ; registerBeanAndWireAndInjectParamsAndInvokeInitMethods ( beanData ) ; bean = beanData . bean ( ) ; } return ( T ) bean ; }
Returns Petite bean instance.
Petite container will find the bean in corresponding scope and all its dependencies,
either by constructor or property injection. When using constructor injection, cyclic dependencies
can not be prevented, but at least they are detected.

@see PetiteContainer#createBean(Class)
Returns Petite bean instance . Petite container will find the bean in corresponding scope and all its dependencies either by constructor or property injection . When using constructor injection cyclic dependencies can not be prevented but at least they are detected .