use of org.mule.runtime.core.privileged.util.AttributeEvaluator in project mule by mulesoft.
the class SetPayloadMessageProcessor method initialise.
@Override
public void initialise() throws InitialisationException {
valueEvaluator = new AttributeEvaluator(value, dataType);
valueEvaluator.initialize(muleContext.getExpressionManager());
}
use of org.mule.runtime.core.privileged.util.AttributeEvaluator in project mule by mulesoft.
the class AbstractRemoveVariablePropertyProcessor method setIdentifier.
public void setIdentifier(String identifier) {
if (StringUtils.isBlank(identifier)) {
throw new IllegalArgumentException("Remove with null identifier is not supported");
}
this.identifierEvaluator = new AttributeEvaluator(identifier, STRING);
this.wildcardAttributeEvaluator = new WildcardAttributeEvaluator(identifier);
}
use of org.mule.runtime.core.privileged.util.AttributeEvaluator in project mule by mulesoft.
the class DWAttributeEvaluatorTestCase method getListOfCarsFromExpression.
@Test
public void getListOfCarsFromExpression() throws MuleException {
AttributeEvaluator attributeEvaluator = getAttributeEvaluator(DW_CAR_LIST, CAR_LIST_DATA_TYPE);
List<Car> cars = attributeEvaluator.resolveValue(newEvent(JSON_CAR, APPLICATION_JSON));
Car car = cars.get(0);
assertThat(car, is(allOf(hasProperty("color", is("RED")), hasProperty("price", is(1000)))));
}
use of org.mule.runtime.core.privileged.util.AttributeEvaluator in project mule by mulesoft.
the class DWAttributeEvaluatorTestCase method getJavaIntFromIntJsonProperty.
@Test
public void getJavaIntFromIntJsonProperty() throws MuleException {
AttributeEvaluator attributeEvaluator = getAttributeEvaluator("#[payload.port]", NUMBER);
CoreEvent event = newEvent(HOST_PORT_JSON, APPLICATION_JSON);
Object port = attributeEvaluator.resolveValue(event);
assertThat(port, is(8081));
}
use of org.mule.runtime.core.privileged.util.AttributeEvaluator in project mule by mulesoft.
the class DWAttributeEvaluatorTestCase method getAttributeEvaluator.
private AttributeEvaluator getAttributeEvaluator(String expression, DataType expectedDataType) {
AttributeEvaluator attributeEvaluator = new AttributeEvaluator(expression, expectedDataType);
attributeEvaluator.initialize(expressionManager);
return attributeEvaluator;
}
Aggregations