Package org.smooks.engine.bean.context
Class StandaloneBeanContext
- java.lang.Object
-
- org.smooks.engine.bean.context.StandaloneBeanContext
-
- All Implemented Interfaces:
org.smooks.api.bean.context.BeanContext
public class StandaloneBeanContext extends Object implements org.smooks.api.bean.context.BeanContext
-
-
Constructor Summary
Constructors Constructor Description StandaloneBeanContext(org.smooks.api.ExecutionContext executionContext, org.smooks.api.bean.context.BeanIdStore beanIdStore, Map<String,Object> beanMap)Create the StandAloneBeanContext
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBean(String beanId, Object bean)voidaddBean(String beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)voidaddBean(org.smooks.api.bean.repository.BeanId beanId, Object bean)voidaddBean(org.smooks.api.bean.repository.BeanId beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)voidaddObserver(org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver observer)voidchangeBean(org.smooks.api.bean.repository.BeanId beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)voidclear()booleancontainsBean(org.smooks.api.bean.repository.BeanId beanId)<T> TgetBean(Class<T> beanType)static <T> TgetBean(Class<T> beanType, Map<String,Object> beanMap)ObjectgetBean(String beanId)ObjectgetBean(org.smooks.api.bean.repository.BeanId beanId)org.smooks.api.bean.repository.BeanIdgetBeanId(String beanId)Map<String,Object>getBeanMap()org.smooks.api.bean.context.BeanContextnewSubContext(org.smooks.api.ExecutionContext executionContext)voidnotifyObservers(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)ObjectremoveBean(String beanId, org.smooks.api.delivery.fragment.Fragment<?> source)ObjectremoveBean(org.smooks.api.bean.repository.BeanId beanId, org.smooks.api.delivery.fragment.Fragment<?> source)voidremoveObserver(org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver observer)voidsetBeanInContext(org.smooks.api.bean.repository.BeanId beanId, boolean inContext)StringtoString()
-
-
-
Constructor Detail
-
StandaloneBeanContext
public StandaloneBeanContext(org.smooks.api.ExecutionContext executionContext, org.smooks.api.bean.context.BeanIdStore beanIdStore, Map<String,Object> beanMap)Create the StandAloneBeanContext- Parameters:
executionContext- TheExecutionContextto which this object is bound to.beanIdStore- TheBeanIdStoreto which this object is bound to.beanMap- TheMapin which the bean's will be set. It is important not to modify this map outside of the BeanRepository! It is only provided as constructor parameter because in some situations we need to control whichMapis used.
-
-
Method Detail
-
addBean
public void addBean(org.smooks.api.bean.repository.BeanId beanId, Object bean)- Specified by:
addBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
addBean
public void addBean(org.smooks.api.bean.repository.BeanId beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)- Specified by:
addBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
addBean
public void addBean(String beanId, Object bean)
- Specified by:
addBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
addBean
public void addBean(String beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)
- Specified by:
addBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
containsBean
public boolean containsBean(org.smooks.api.bean.repository.BeanId beanId)
- Specified by:
containsBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
getBeanId
public org.smooks.api.bean.repository.BeanId getBeanId(String beanId)
- Specified by:
getBeanIdin interfaceorg.smooks.api.bean.context.BeanContext
-
getBean
public Object getBean(org.smooks.api.bean.repository.BeanId beanId)
- Specified by:
getBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
getBean
public Object getBean(String beanId)
- Specified by:
getBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
getBean
public <T> T getBean(Class<T> beanType)
- Specified by:
getBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
changeBean
public void changeBean(org.smooks.api.bean.repository.BeanId beanId, Object bean, org.smooks.api.delivery.fragment.Fragment<?> source)- Specified by:
changeBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
removeBean
public Object removeBean(org.smooks.api.bean.repository.BeanId beanId, org.smooks.api.delivery.fragment.Fragment<?> source)
- Specified by:
removeBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
removeBean
public Object removeBean(String beanId, org.smooks.api.delivery.fragment.Fragment<?> source)
- Specified by:
removeBeanin interfaceorg.smooks.api.bean.context.BeanContext
-
clear
public void clear()
- Specified by:
clearin interfaceorg.smooks.api.bean.context.BeanContext
-
getBeanMap
public Map<String,Object> getBeanMap()
- Specified by:
getBeanMapin interfaceorg.smooks.api.bean.context.BeanContext
-
setBeanInContext
public void setBeanInContext(org.smooks.api.bean.repository.BeanId beanId, boolean inContext)- Specified by:
setBeanInContextin interfaceorg.smooks.api.bean.context.BeanContext
-
newSubContext
public org.smooks.api.bean.context.BeanContext newSubContext(org.smooks.api.ExecutionContext executionContext)
- Specified by:
newSubContextin interfaceorg.smooks.api.bean.context.BeanContext
-
addObserver
public void addObserver(org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver observer)
- Specified by:
addObserverin interfaceorg.smooks.api.bean.context.BeanContext
-
notifyObservers
public void notifyObservers(org.smooks.api.bean.lifecycle.BeanContextLifecycleEvent event)
- Specified by:
notifyObserversin interfaceorg.smooks.api.bean.context.BeanContext
-
removeObserver
public void removeObserver(org.smooks.api.bean.lifecycle.BeanContextLifecycleObserver observer)
- Specified by:
removeObserverin interfaceorg.smooks.api.bean.context.BeanContext
-
-