public class BeanInstancePopulator extends Object implements DOMElementVisitor, SAXVisitBefore, SAXVisitAfter, Producer, Consumer
Modifier and Type | Field and Description |
---|---|
static String |
NOTIFY_POPULATE |
static String |
VALUE_ATTRIBUTE_NAME |
static String |
VALUE_ATTRIBUTE_PREFIX |
Constructor and Description |
---|
BeanInstancePopulator() |
Modifier and Type | Method and Description |
---|---|
boolean |
consumes(Object object)
Does this consumer consume the specified named object.
|
String |
getBeanId() |
SmooksResourceConfiguration |
getConfig() |
DataDecoder |
getDecoder() |
DataDecoder |
getDecoder(ContentDeliveryConfig deliveryConfig) |
Set<? extends Object> |
getProducts()
Get the set of products produced by this producer instance.
|
String |
getProperty() |
String |
getWireBeanId() |
void |
initialize()
Set the resource configuration on the bean populator.
|
boolean |
isBeanWiring() |
void |
populateAndSetPropertyValue(Object bean,
BeanContext beanContext,
BeanId targetBeanId,
ExecutionContext executionContext,
Fragment source) |
void |
setBeanId(String beanId) |
void |
setDecoder(DataDecoder decoder) |
void |
setDefaultVal(String defaultVal) |
void |
setExpression(MVELExpressionEvaluator expression) |
void |
setProperty(String property) |
void |
setPropertyValue(String mapPropertyName,
Object dataObject,
ExecutionContext executionContext,
Fragment source) |
void |
setSetterMethod(String setterMethod) |
void |
setTypeAlias(String typeAlias) |
void |
setValueAttributeName(String valueAttributeName) |
void |
setValueAttributePrefix(String valueAttributePrefix) |
void |
setWireBeanId(String wireBeanId) |
void |
visitAfter(Element element,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitAfter(SAXElement element,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitBefore(Element element,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
void |
visitBefore(SAXElement element,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
public static final String VALUE_ATTRIBUTE_NAME
public static final String VALUE_ATTRIBUTE_PREFIX
public static final String NOTIFY_POPULATE
public SmooksResourceConfiguration getConfig()
public void setBeanId(String beanId)
public String getBeanId()
public void setWireBeanId(String wireBeanId)
public String getWireBeanId()
public void setExpression(MVELExpressionEvaluator expression)
public void setProperty(String property)
public String getProperty()
public void setSetterMethod(String setterMethod)
public void setValueAttributeName(String valueAttributeName)
public void setValueAttributePrefix(String valueAttributePrefix)
public void setTypeAlias(String typeAlias)
public void setDecoder(DataDecoder decoder)
public DataDecoder getDecoder()
public void setDefaultVal(String defaultVal)
public boolean isBeanWiring()
@Initialize public void initialize() throws SmooksConfigurationException
SmooksConfigurationException
- Incorrectly configured resource.public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitBefore
visitBefore
in interface DOMVisitBefore
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void visitAfter(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitAfter
visitAfter
in interface DOMVisitAfter
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitBefore
visitBefore
in interface SAXVisitBefore
element
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public void visitAfter(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitAfter
visitAfter
in interface SAXVisitAfter
element
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public void populateAndSetPropertyValue(Object bean, BeanContext beanContext, BeanId targetBeanId, ExecutionContext executionContext, Fragment source)
public void setPropertyValue(String mapPropertyName, Object dataObject, ExecutionContext executionContext, Fragment source)
public DataDecoder getDecoder(ContentDeliveryConfig deliveryConfig)
public Set<? extends Object> getProducts()
Producer
getProducts
in interface Producer
public boolean consumes(Object object)
Consumer
Producer
that is executing
on the same element. The consumer should only return false
if it knows for
certain that it doesn't consumer the specified named object. If uncertain, it should
error on the side of saying that it does consume the object.Copyright © 2020. All rights reserved.