1 /*
2 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
3 * The software in this package is published under the terms of the CPAL v1.0
4 * license, a copy of which has been included with this distribution in the
5 * LICENSE.txt file.
6 */
7 package org.mule.api.annotations.expression;
8
9 import org.mule.api.annotations.meta.Evaluator;
10
11 import java.lang.annotation.Documented;
12 import java.lang.annotation.ElementType;
13 import java.lang.annotation.Retention;
14 import java.lang.annotation.RetentionPolicy;
15 import java.lang.annotation.Target;
16
17 /**
18 * An expression annotation that allows developers to control how method parameter values are injected on a service component or transformer.
19 * This parameter level annotation enables an XPath expression to be execute on an Xml payload of a message.
20 *
21 * The annotation uses the standard JAXP api and this dictates what method parameter types the annotaiton can be used with. The follonig parameter types are supported
22 * <ul>
23 * <li>{@link Boolean}</li>
24 * <li>{@link String}</li>
25 * <li>{@link Double}</li>
26 * <li>{@link org.w3c.dom.Node}</li>
27 * <li>{@link org.w3c.dom.NodeList}</li>
28 * <li>{@link org.w3c.dom.Element}</li>
29 * <li>{@link org.w3c.dom.Document}</li>
30 * </ul>
31 *
32 * See {@link javax.xml.xpath.XPathConstants} for further information.
33 *
34 */
35 @Target(ElementType.PARAMETER)
36 @Retention(RetentionPolicy.RUNTIME)
37 @Documented
38 @Evaluator("xpath2")
39 public @interface XPath
40 {
41 String value();
42
43 boolean optional() default false;
44 }