Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MessageHeadersExpressionEvaluator |
|
| 1.3333333333333333;1.333 |
1 | /* | |
2 | * $Id: MessageHeadersExpressionEvaluator.java 19191 2010-08-25 21:05:23Z tcarlson $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.expression; | |
12 | ||
13 | import org.mule.api.MuleMessage; | |
14 | import org.mule.api.expression.ExpressionEvaluator; | |
15 | ||
16 | import java.util.Map; | |
17 | ||
18 | /** | |
19 | * Looks up the property on the message using the expression given. The expression can contain a comma-separated list | |
20 | * of header names to lookup. A {@link java.util.Map} of key value pairs is returned. | |
21 | * | |
22 | * @see MessageHeadersListExpressionEvaluator | |
23 | * @see org.mule.api.expression.ExpressionEvaluator | |
24 | * @see DefaultExpressionManager | |
25 | */ | |
26 | 0 | public class MessageHeadersExpressionEvaluator implements ExpressionEvaluator, ExpressionConstants |
27 | { | |
28 | public static final String NAME = "headers"; | |
29 | ||
30 | public Object evaluate(String expression, MuleMessage message) | |
31 | { | |
32 | 0 | return ExpressionUtils.getPropertyWithScope(expression, message, Map.class); |
33 | } | |
34 | ||
35 | /** | |
36 | * {@inheritDoc} | |
37 | */ | |
38 | public String getName() | |
39 | { | |
40 | 0 | return NAME; |
41 | } | |
42 | ||
43 | /** | |
44 | * {@inheritDoc} | |
45 | */ | |
46 | public void setName(String name) | |
47 | { | |
48 | 0 | throw new UnsupportedOperationException(); |
49 | } | |
50 | } |