public class BeanInstanceCreator extends Object implements org.smooks.api.resource.visitor.sax.ng.BeforeVisitor, org.smooks.api.resource.visitor.sax.ng.AfterVisitor, org.smooks.api.delivery.ordering.Producer, org.smooks.api.lifecycle.PostFragmentLifecycle, org.smooks.api.lifecycle.ContentDeliveryConfigLifecycle
Modifier and Type | Field and Description |
---|---|
protected org.smooks.api.ApplicationContext |
applicationContext |
protected Optional<String> |
beanClassName |
protected Optional<String> |
beanFactoryDefinition |
protected org.smooks.api.bean.repository.BeanId |
beanId |
protected String |
beanIdName |
protected BeanRuntimeInfo |
beanRuntimeInfo |
protected org.smooks.api.resource.config.ResourceConfig |
config |
protected Factory<?> |
factory |
protected String |
id |
static String |
INIT_VAL_EXPRESSION |
protected org.smooks.engine.expression.MVELExpressionEvaluator |
initValsExpression |
protected static org.slf4j.Logger |
LOGGER |
protected Boolean |
retain |
Constructor and Description |
---|
BeanInstanceCreator()
Public default constructor.
|
BeanInstanceCreator(String beanId,
Class<?> beanClass)
Public default constructor.
|
BeanInstanceCreator(String beanId,
Class<T> beanClass,
Factory<? extends T> factory)
Public default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildId() |
protected void |
checkForDefaultConstructor()
Checks if the class has a default constructor
|
protected Object |
convert(org.smooks.api.ExecutionContext executionContext,
Object bean,
org.smooks.api.delivery.fragment.Fragment source) |
protected void |
createAndSetBean(org.smooks.api.ExecutionContext executionContext,
org.smooks.api.delivery.fragment.Fragment source) |
protected Object |
createBeanInstance(org.smooks.api.ExecutionContext executionContext)
Create a new bean instance, generating relevant configuration exceptions.
|
String |
getBeanId()
Get the beanId of this Bean configuration.
|
BeanRuntimeInfo |
getBeanRuntimeInfo()
Get the bean runtime information.
|
org.smooks.api.resource.config.ResourceConfig |
getConfig() |
protected String |
getId() |
Set<?> |
getProducts() |
void |
onContentDeliveryBuilderCreated() |
void |
onContentDeliveryConfigCreated() |
void |
onContentHandlersCreated() |
void |
onPostFragment(org.smooks.api.delivery.fragment.Fragment fragment,
org.smooks.api.ExecutionContext executionContext) |
void |
postConstruct()
Set the resource configuration on the bean populator.
|
protected String |
toClassName(Class<?> beanClass) |
String |
toString() |
void |
visitAfter(Element element,
org.smooks.api.ExecutionContext executionContext) |
void |
visitAfter(org.smooks.api.ExecutionContext executionContext,
org.smooks.api.delivery.fragment.Fragment source) |
void |
visitBefore(Element element,
org.smooks.api.ExecutionContext executionContext) |
protected static final org.slf4j.Logger LOGGER
public static final String INIT_VAL_EXPRESSION
protected String id
@Inject @Named(value="beanId") protected String beanIdName
@Inject @Named(value="beanFactory") protected Optional<String> beanFactoryDefinition
@Inject protected Boolean retain
@Inject protected org.smooks.api.resource.config.ResourceConfig config
@Inject protected org.smooks.api.ApplicationContext applicationContext
protected BeanRuntimeInfo beanRuntimeInfo
protected org.smooks.api.bean.repository.BeanId beanId
protected org.smooks.engine.expression.MVELExpressionEvaluator initValsExpression
protected Factory<?> factory
public BeanInstanceCreator()
public BeanInstanceCreator(String beanId, Class<?> beanClass)
beanId
- The beanId under which the bean instance is registered in the bean context.beanClass
- The bean runtime class.public String getBeanId()
public org.smooks.api.resource.config.ResourceConfig getConfig()
@PostConstruct public void postConstruct() throws org.smooks.api.SmooksConfigException
org.smooks.api.SmooksConfigException
- Incorrectly configured resource.public BeanRuntimeInfo getBeanRuntimeInfo()
protected void buildId()
public void visitBefore(Element element, org.smooks.api.ExecutionContext executionContext) throws org.smooks.api.SmooksException
visitBefore
in interface org.smooks.api.resource.visitor.sax.ng.BeforeVisitor
org.smooks.api.SmooksException
public void visitAfter(Element element, org.smooks.api.ExecutionContext executionContext) throws org.smooks.api.SmooksException
visitAfter
in interface org.smooks.api.resource.visitor.sax.ng.AfterVisitor
org.smooks.api.SmooksException
public void visitAfter(org.smooks.api.ExecutionContext executionContext, org.smooks.api.delivery.fragment.Fragment source)
protected Object convert(org.smooks.api.ExecutionContext executionContext, Object bean, org.smooks.api.delivery.fragment.Fragment source)
protected void createAndSetBean(org.smooks.api.ExecutionContext executionContext, org.smooks.api.delivery.fragment.Fragment source)
protected Object createBeanInstance(org.smooks.api.ExecutionContext executionContext)
public Set<?> getProducts()
getProducts
in interface org.smooks.api.delivery.ordering.Producer
protected String getId()
protected void checkForDefaultConstructor()
public void onPostFragment(org.smooks.api.delivery.fragment.Fragment fragment, org.smooks.api.ExecutionContext executionContext)
onPostFragment
in interface org.smooks.api.lifecycle.PostFragmentLifecycle
public void onContentHandlersCreated()
onContentHandlersCreated
in interface org.smooks.api.lifecycle.ContentDeliveryConfigLifecycle
public void onContentDeliveryBuilderCreated()
onContentDeliveryBuilderCreated
in interface org.smooks.api.lifecycle.ContentDeliveryConfigLifecycle
public void onContentDeliveryConfigCreated()
onContentDeliveryConfigCreated
in interface org.smooks.api.lifecycle.ContentDeliveryConfigLifecycle
Copyright © 2024. All rights reserved.