01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.synapse.mediators;
21:
22: import org.apache.synapse.MessageContext;
23: import org.apache.synapse.config.xml.XMLConfigConstants;
24: import org.apache.synapse.util.xpath.SynapseXPath;
25:
26: import javax.xml.namespace.QName;
27:
28: /**
29: * A mediator property is a name-value or name-expression pair which could be supplied
30: * for certain mediators. If expressions are supplied they are evaluated at the runtime
31: * against the current message into literal String values.
32: */
33: public class MediatorProperty {
34:
35: public static final QName PROPERTY_Q = new QName(
36: XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
37: public static final QName ATT_NAME_Q = new QName(
38: XMLConfigConstants.NULL_NAMESPACE, "name");
39: public static final QName ATT_VALUE_Q = new QName(
40: XMLConfigConstants.NULL_NAMESPACE, "value");
41: public static final QName ATT_EXPR_Q = new QName(
42: XMLConfigConstants.NULL_NAMESPACE, "expression");
43:
44: private String name;
45: private String value;
46: private SynapseXPath expression;
47:
48: public MediatorProperty() {
49: }
50:
51: public String getName() {
52: return name;
53: }
54:
55: public void setName(String name) {
56: this .name = name;
57: }
58:
59: public String getValue() {
60: return value;
61: }
62:
63: public void setValue(String value) {
64: this .value = value;
65: }
66:
67: public SynapseXPath getExpression() {
68: return expression;
69: }
70:
71: public void setExpression(SynapseXPath expression) {
72: this .expression = expression;
73: }
74:
75: public String getEvaluatedExpression(MessageContext synCtx) {
76: return expression.getStringValue(synCtx);
77: }
78:
79: }
|