Errai 3.0.1-SNAPSHOT

org.jboss.errai.ioc.rebind.ioc.injector.basic
Class TypeInjector

java.lang.Object
  extended by org.jboss.errai.ioc.rebind.ioc.injector.AbstractInjector
      extended by org.jboss.errai.ioc.rebind.ioc.injector.basic.TypeInjector
All Implemented Interfaces:
Injector
Direct Known Subclasses:
AsyncContextualProviderInjector, ContextualProviderInjector, ProviderInjector

public class TypeInjector
extends AbstractInjector

This injector implementation is responsible for the lion's share of the container's workload. It is responsible for generating the SimpleCreationalContext's which produce instances of beans. It is also responsible for handling the differences in semantics between singleton and dependent-scoped beans.

Author:
Mike Brock

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.errai.ioc.rebind.ioc.injector.AbstractInjector
AbstractInjector.RegisterCache
 
Field Summary
protected  String instanceVarName
           
protected  MetaClass type
           
 
Fields inherited from class org.jboss.errai.ioc.rebind.ioc.injector.AbstractInjector
_registerCache, alternative, attributes, basic, beanName, creationalCallbackVarName, enabled, enclosingType, postInitCallbackVar, preDestroyCallbackVar, provider, qualifyingMetadata, qualifyingTypeInformation, replaceable, singleton, softDisabled, testMock
 
Constructor Summary
TypeInjector(MetaClass type, InjectionContext context)
           
 
Method Summary
 Statement getBeanInstance(InjectableInstance injectableInstance)
          Return a statement providing access to the injector (or null for asynchronous logic)
 String getCreationalCallbackVarName()
          The unique variable name for a BeanProvider associated with this bean.
 MetaClass getInjectedType()
          The injected type of the injector.
 String getInstanceVarName()
          The unique variable name for the bean instance.
 boolean isPseudo()
          Checks if the injector is a psuedo bean.
 boolean isRegularTypeInjector()
          Returns true if the injector type is a regular type injector.
 void renderProvider(InjectableInstance injectableInstance)
           
 
Methods inherited from class org.jboss.errai.ioc.rebind.ioc.injector.AbstractInjector
addDisablingHook, addInvokeAfter, addInvokeAround, addInvokeBefore, addProxyProperty, addProxyProperty, addRegistrationHook, addRenderingHook, addStatementToEndOfInjector, createProxyDeclaration, createProxyDeclaration, disableSoftly, getAddToEndStatements, getAttribute, getBeanName, getConcreteInjectedType, getDisablingCallbacks, getEnclosingType, getMetadataWithAny, getPostInitCallbackVar, getPreDestroyCallbackVar, getProxyInstanceVarName, getProxyPropertyMap, getQualifyingMetadata, getQualifyingTypeInformation, getRegistrationHooks, getRenderingHooks, getWeavingStatements, getWeavingStatementsMap, hasAttribute, hasNewQualifier, isAlternative, isCreated, isDependent, isEnabled, isProvider, isProxied, isRendered, isSingleton, isSoftDisabled, isStatic, isTestMock, markRendered, matches, registerWithBeanManager, setAttribute, setCreated, setCreationalCallbackVarName, setEnabled, setPostInitCallbackVar, setPreDestroyCallbackVar, setRendered, setReplaceable, setSoftDisabled, toString, updateProxies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected final MetaClass type

instanceVarName

protected String instanceVarName
Constructor Detail

TypeInjector

public TypeInjector(MetaClass type,
                    InjectionContext context)
Method Detail

renderProvider

public void renderProvider(InjectableInstance injectableInstance)

getBeanInstance

public Statement getBeanInstance(InjectableInstance injectableInstance)
Description copied from interface: Injector
Return a statement providing access to the injector (or null for asynchronous logic)

Returns:

isPseudo

public boolean isPseudo()
Description copied from interface: Injector
Checks if the injector is a psuedo bean. A psuedo bean is a bean which has been discovered in the classpath and is by default considered part of the dependent scope. But it's scope may be overridden through further processing.

Specified by:
isPseudo in interface Injector
Overrides:
isPseudo in class AbstractInjector
Returns:
true if the injector is for a psuedo bean.

getInstanceVarName

public String getInstanceVarName()
Description copied from interface: Injector
The unique variable name for the bean instance. Usually used to reference the bean during the wiring of the bean within the CreationalContext.getInstance() method body. This variable name is also used to provide a name to variable which holds a reference to singleton instances.

Specified by:
getInstanceVarName in interface Injector
Overrides:
getInstanceVarName in class AbstractInjector
Returns:
the unique variable name for a bean in the bootstrapper and CreationalContext.getInstance() method.

getInjectedType

public MetaClass getInjectedType()
Description copied from interface: Injector
The injected type of the injector. This is the absolute type which the injector produces. For producers, this is the bean type which the producer method returns.

Returns:
the return type from the injector.

getCreationalCallbackVarName

public String getCreationalCallbackVarName()
Description copied from interface: Injector
The unique variable name for a BeanProvider associated with this bean.

Specified by:
getCreationalCallbackVarName in interface Injector
Overrides:
getCreationalCallbackVarName in class AbstractInjector
Returns:
the unique variable name for the BeanProvider.

isRegularTypeInjector

public boolean isRegularTypeInjector()
Description copied from interface: Injector
Returns true if the injector type is a regular type injector. (ie. not a proxy injector, producer injector, etc).

Specified by:
isRegularTypeInjector in interface Injector
Overrides:
isRegularTypeInjector in class AbstractInjector
Returns:
true if the injector is a regular type injector.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.