This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch feature/CAMEL-23789-wave2-multi-dsl-docs in repository https://gitbox.apache.org/repos/asf/camel.git
commit b4e25386a1880a456eacb2083ca0b7db41cfb22b Author: Claus Ibsen <[email protected]> AuthorDate: Thu Jun 18 11:57:02 2026 +0200 CAMEL-23789: Add Java-only markers to test, language, and mock docs (Wave 2) Co-Authored-By: Claude <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel-joor/src/main/docs/java-language.adoc | 17 +++++++++++++++++ .../camel-joor/src/main/docs/joor-language.adoc | 19 +++++++++++++++++-- .../camel-mock/src/main/docs/mock-component.adoc | 22 ++++++++++++++++++++++ .../src/main/docs/test-junit5.adoc | 3 +++ .../src/main/docs/test-main-junit5.adoc | 2 ++ .../src/main/docs/test-main-junit6.adoc | 2 ++ .../src/main/docs/test-spring-junit5.adoc | 4 ++++ .../src/main/docs/test-spring-junit6.adoc | 4 ++++ .../camel-xpath/src/main/docs/xpath-language.adoc | 6 ++++++ 9 files changed, 77 insertions(+), 2 deletions(-) diff --git a/components/camel-joor/src/main/docs/java-language.adoc b/components/camel-joor/src/main/docs/java-language.adoc index 41c1616264b6..8e55719efb98 100644 --- a/components/camel-joor/src/main/docs/java-language.adoc +++ b/components/camel-joor/src/main/docs/java-language.adoc @@ -60,6 +60,7 @@ These functions are convenient for getting the message body, header or exchange Here we want to get the message body as a `com.foo.MyUser` type we can do as follows: +._Java-only: Java language expression using bodyAs function_ [source,java] ---- var user = bodyAs(com.foo.MyUser.class); @@ -67,6 +68,7 @@ var user = bodyAs(com.foo.MyUser.class); You can omit _.class_ to make the function a little smaller: +._Java-only: Java language expression with simplified bodyAs syntax_ [source,java] ---- var user = bodyAs(com.foo.MyUser); @@ -82,6 +84,7 @@ import com.foo.MyUser; And then the function can be shortened: +._Java-only: Java language expression with imported type_ [source,java] ---- var user = bodyAs(MyUser); @@ -97,6 +100,7 @@ In the Java code you declare the injected beans using the syntax `#bean:beanId`. For example, suppose we have the following bean +._Java-only: bean class used for dependency injection_ [source,java] ---- public class MyEchoBean { @@ -115,6 +119,7 @@ And this bean is registered with the name `myEcho` in the Camel registry. The Java code can then inject this bean directly in the script where the bean is in use: +._Java-only: Java DSL route with bean injection syntax_ [source,java] ---- from("direct:start") @@ -126,6 +131,7 @@ Now this code may seem a bit magic, but what happens is that the `myEcho` bean i Under the hood, Camel Java generates the following source code compiled once: +._Java-only: generated source code showing dependency injection internals_ [source,java] ---- public class JoorScript1 implements org.apache.camel.language.joor.JoorMethod { @@ -145,6 +151,7 @@ public class JoorScript1 implements org.apache.camel.language.joor.JoorMethod { You can also store a reference to the bean in a variable which would more resemble how you would code in Java +._Java-only: Java DSL route with bean variable reference_ [source,java] ---- from("direct:start") @@ -160,6 +167,7 @@ Therefore, we use _bean_ as name in the script. The Java language will automatically import from: +._Java-only: default auto-imported packages_ [source,java] ---- import java.util.*; @@ -176,6 +184,7 @@ You can specify a different location with the `configResource` option on the Jav For example, you can add additional imports in the `camel-joor.properties` file by adding: +._Java-only: custom imports in camel-joor.properties_ [source,java] ---- import com.foo.MyUser; @@ -192,6 +201,7 @@ echo()=bodyAs(String) + bodyAs(String) Which allows using `echo()` in the jOOR language script such as: +._Java-only: Java DSL route using alias function_ [source,java] ---- from("direct:hello") @@ -201,6 +211,7 @@ from("direct:hello") The `echo()` alias will be replaced with its value resulting in a script as: +._Java-only: expanded alias result in Java DSL_ [source,java] ---- .transform(java("'Hello ' + bodyAs(String) + bodyAs(String)")) @@ -208,6 +219,7 @@ The `echo()` alias will be replaced with its value resulting in a script as: You can configure a custom configuration location for the `camel-joor.properties` file or reference to a bean in the registry: +._Java-only: programmatic language configuration_ [source,java] ---- JavaLanguage joor = (JavaLanguage) context.resolveLanguage("java"); @@ -216,6 +228,7 @@ java.setConfigResource("ref:MyJoorConfig"); And then register a bean in the registry with id `MyJoorConfig` that is a String value with the content. +._Java-only: programmatic registry bean configuration_ [source,java] ---- String config = "...."; @@ -273,6 +286,7 @@ It is possible to include multiple statements. The code below shows an example where the `user` header is retrieved in a first statement. And then, in a second statement we return a value whether the user is `null` or not. +._Java-only: Java DSL route with multi-statement expression_ [source,java] ---- from("seda:orders") @@ -282,6 +296,7 @@ from("seda:orders") Notice how we have to quote strings in strings, and that is annoying, so instead we can use single quotes: +._Java-only: Java DSL route using single-quote syntax_ [source,java] ---- from("seda:orders") @@ -294,6 +309,7 @@ from("seda:orders") You can turn off pre-compilation for the Java language and then Camel will recompile the script for each message. You can externalize the code into a resource file, which will be reloaded on each message as shown: +._Java-only: programmatic hot-reload configuration with Java DSL_ [source,java] ---- JavaLanguage java = (JavaLanguage) context.resolveLanguage("java"); @@ -337,6 +353,7 @@ The lambda syntax is representing a Java util `BiFunction<Exchange, Exchange, Ob For example, to aggregate message bodies together, we can do this as shown: +._Java-only: lambda-based aggregation strategy expression_ [source,java] ---- (e1, e2) -> { diff --git a/components/camel-joor/src/main/docs/joor-language.adoc b/components/camel-joor/src/main/docs/joor-language.adoc index 1c50675fac33..ca5d916e6058 100644 --- a/components/camel-joor/src/main/docs/joor-language.adoc +++ b/components/camel-joor/src/main/docs/joor-language.adoc @@ -65,6 +65,7 @@ These functions are convenient for getting the message body, header or exchange Here we want to get the message body as a `com.foo.MyUser` type we can do as follows: +._Java-only: jOOR type conversion function_ [source,java] ---- var user = bodyAs(com.foo.MyUser.class); @@ -72,6 +73,7 @@ var user = bodyAs(com.foo.MyUser.class); You can omit _.class_ to make the function a little smaller: +._Java-only: jOOR shorthand type conversion_ [source,java] ---- var user = bodyAs(com.foo.MyUser); @@ -87,6 +89,7 @@ import com.foo.MyUser; And then the function can be shortened: +._Java-only: jOOR type conversion with imported class_ [source,java] ---- var user = bodyAs(MyUser); @@ -102,6 +105,7 @@ In the jOOR script you declare the injected beans using the syntax `#bean:beanId For example, suppose we have the following bean +._Java-only: bean class used for dependency injection_ [source,java] ---- public class MyEchoBean { @@ -120,6 +124,7 @@ And this bean is registered with the name `myEcho` in the Camel registry. The jOOR script can then inject this bean directly in the script where the bean is in use: +._Java-only: jOOR bean injection in route_ [source,java] ---- from("direct:start") @@ -131,6 +136,7 @@ Now this code may seem a bit magic, but what happens is that the `myEcho` bean i Under the hood, Camel jOOR generates the following source code compiled once: +._Java-only: generated compiled jOOR script class_ [source,java] ---- public class JoorScript1 implements org.apache.camel.language.joor.JoorMethod { @@ -150,6 +156,7 @@ public class JoorScript1 implements org.apache.camel.language.joor.JoorMethod { You can also store a reference to the bean in a variable which would more resemble how you would code in Java +._Java-only: jOOR bean variable reference in route_ [source,java] ---- from("direct:start") @@ -165,6 +172,7 @@ Therefore, we use _bean_ as name in the script. The jOOR language will automatically import from: +._Java-only: jOOR auto-imported packages_ [source,java] ---- import java.util.*; @@ -197,6 +205,7 @@ echo()=bodyAs(String) + bodyAs(String) Which allows using `echo()` in the jOOR language script such as: +._Java-only: jOOR alias usage in route_ [source,java] ---- from("direct:hello") @@ -206,6 +215,7 @@ from("direct:hello") The `echo()` alias will be replaced with its value resulting in a script as: +._Java-only: jOOR alias expansion result_ [source,java] ---- .transform(joor("'Hello ' + bodyAs(String) + bodyAs(String)")) @@ -213,6 +223,7 @@ The `echo()` alias will be replaced with its value resulting in a script as: You can configure a custom configuration location for the `camel-joor.properties` file or reference to a bean in the registry: +._Java-only: programmatic language configuration_ [source,java] ---- JoorLanguage joor = (JoorLanguage) context.resolveLanguage("joor"); @@ -221,6 +232,7 @@ joor.setConfigResource("ref:MyJoorConfig"); And then register a bean in the registry with id `MyJoorConfig` that is a String value with the content. +._Java-only: programmatic bean registration_ [source,java] ---- String config = "...."; @@ -279,6 +291,7 @@ It is possible to include multiple statements. The code below shows an example where the `user` header is retrieved in a first statement. And then, in a second statement we return a value whether the user is `null` or not. +._Java-only: jOOR multi-statement expression in route_ [source,java] ---- from("seda:orders") @@ -288,6 +301,7 @@ from("seda:orders") Notice how we have to quote strings in strings, and that is annoying, so instead we can use single quotes: +._Java-only: jOOR single-quoted string syntax_ [source,java] ---- from("seda:orders") @@ -369,6 +383,7 @@ The lambda syntax is representing a Java util `BiFunction<Exchange, Exchange, Ob For example, to aggregate message bodies together, we can do this as shown: +._Java-only: jOOR lambda-based aggregation strategy_ [source,java] ---- (e1, e2) -> { @@ -393,12 +408,12 @@ To use scripting languages in your camel routes, you need to add a dependency on If you use Maven you could add the following to your `pom.xml`, substituting the version number for the latest and greatest release. [source,xml] ---------------------------------------- +---- <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-joor</artifactId> <version>x.x.x</version> </dependency> ---------------------------------------- +---- include::spring-boot:partial$starter.adoc[] diff --git a/components/camel-mock/src/main/docs/mock-component.adoc b/components/camel-mock/src/main/docs/mock-component.adoc index e3572ad251ca..533cdbc5676e 100644 --- a/components/camel-mock/src/main/docs/mock-component.adoc +++ b/components/camel-mock/src/main/docs/mock-component.adoc @@ -96,6 +96,7 @@ Here's a simple example of Mock endpoint in use. First, the endpoint is resolved on the context. Then we set an expectation, and then, after the test has run, we assert that our expectations have been met: +._Java-only: MockEndpoint assertion API_ [source,java] ---- MockEndpoint resultEndpoint = context.getEndpoint("mock:foo", MockEndpoint.class); @@ -126,6 +127,7 @@ will not affect the outcome of the assertion. Suppose you do want to test that no new messages arrives after a period thereafter, then you can do that by setting the `setAssertPeriod` method, for example: +._Java-only: programmatic mock expectations with assert period_ [source,java] ---- MockEndpoint resultEndpoint = context.getEndpoint("mock:foo", MockEndpoint.class); @@ -177,6 +179,7 @@ JMS, or some unique reference number within the message. Here's another example: +._Java-only: MockEndpoint assertion API_ [source,java] ---- resultEndpoint.expectedBodiesReceived("firstMessageBody", "secondMessageBody", "thirdMessageBody"); @@ -193,6 +196,7 @@ For example, to add expectations of the headers or body of the first message (using zero-based indexing like `java.util.List`), you can use the following code: +._Java-only: programmatic mock expectations on specific messages_ [source,java] ---- resultEndpoint.message(0).header("foo").isEqualTo("bar"); @@ -212,6 +216,7 @@ See next section for how to use all the Camel languages using the language build You can use regular expressions as expectations, as follows: +._Java-only: mock endpoint regex expectations_ [source,java] ---- mock.message(1).header("cheese").regex("value[2,3]"); @@ -226,6 +231,7 @@ coding this easier. There are a limited set of functions out of the box. You can also use XPath as follows: +._Java-only: mock endpoint XPath expectations_ [source,java] ---- String filter = "/person[@name='James']"; @@ -237,6 +243,7 @@ mock.message(2).header("cheese").xpath(filter).isFalse(); You can also use xpath to check if it matches a given value such as: +._Java-only: mock endpoint XPath value expectations_ [source,java] ---- String name = "/person/@name"; @@ -255,6 +262,7 @@ then you can use the Camel languages to perform the validation. For example to check whether a header matches a XPath you can do as follows: +._Java-only: mock endpoint language builder expectations_ [source,java] ---- // setup the xpath once @@ -271,6 +279,7 @@ you to use any of the many Camel languages, and to configure every option you ma If you only need to use the expectation once, you can inline this directly in the mock as follows: +._Java-only: inline mock endpoint language builder expectation_ [source,java] ---- mock.message(1).predicate(expression().xpath("/person[@name='James']").source("header:cheese").end()); @@ -289,6 +298,7 @@ to use Java programming to compute the returned value. For example, you can write a custom function that takes an int as input and return the double value. And then use this in mock as follows: +._Java-only: custom Function for mock expectations_ [source,java] ---- mock.message(0).header("num").expression(o -> { @@ -313,6 +323,7 @@ can view this as a kind of intercept and delegate or endpoint listener. Suppose you have the given route below: +._Java-only: Java test route definition_ [source,java] .*Route* ---- @@ -322,6 +333,7 @@ include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/processor/ You can then use the `adviceWith` feature in Camel to mock all the endpoints in a given route from your unit test, as shown below: +._Java-only: adviceWith mock endpoint test pattern_ [source,java] .*`adviceWith` mocking all endpoints* ---- @@ -346,6 +358,7 @@ removed. It's also possible to only mock certain endpoints using a pattern. For example to mock all `log` endpoints you do as shown: +._Java-only: adviceWith mock endpoint test pattern with URI filter_ [source,java] .*`adviceWith` mocking only log endpoints using a pattern* ---- @@ -376,6 +389,7 @@ endpoints. If you only want to mock all `log` endpoints you can return `"log*"` instead. +._Java-only: camel-test kit mock endpoint test pattern_ [source,java] .*`isMockEndpoints` using camel-test kit* ---- @@ -432,6 +446,7 @@ only. You can now use the `mockEndpointsAndSkip` method using AdviceWith. The example below will skip sending to the two endpoints `"direct:foo"`, and `"direct:bar"`. +._Java-only: adviceWith mock and skip endpoint test pattern_ [source,java] .*adviceWith mock and skip sending to endpoints* ---- @@ -440,6 +455,7 @@ include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/processor/ The same example using the Test Kit +._Java-only: camel-test kit mock and skip endpoint test pattern_ [source,java] .*isMockEndpointsAndSkip using camel-test kit* ---- @@ -458,6 +474,7 @@ and/or last Exchanges. For example, in the code below, we only want to retain a copy of the first five and last five Exchanges the mock receives. +._Java-only: programmatic mock expectations with retain limits_ [source,java] ---- MockEndpoint mock = getMockEndpoint("mock:data"); @@ -484,6 +501,7 @@ expectations on the 10 retained messages. The xref:mock-component.adoc[Mock] endpoint stores the arrival time of the message as a property on the Exchange. +._Java-only: Exchange property access API_ [source,java] ---- Date time = exchange.getProperty(Exchange.RECEIVED_TIMESTAMP, Date.class); @@ -498,6 +516,7 @@ endpoint. For example, to say that the first message should arrive between 0 and 2 seconds before the next you can do: +._Java-only: mock endpoint arrival time expectations_ [source,java] ---- mock.message(0).arrives().noLaterThan(2).seconds().beforeNext(); @@ -506,6 +525,7 @@ mock.message(0).arrives().noLaterThan(2).seconds().beforeNext(); You can also define this as that second message (0 index based) should arrive no later than 0 and 2 seconds after the previous: +._Java-only: mock endpoint arrival time expectations_ [source,java] ---- mock.message(1).arrives().noLaterThan(2).seconds().afterPrevious(); @@ -514,6 +534,7 @@ mock.message(1).arrives().noLaterThan(2).seconds().afterPrevious(); You can also use between to set a lower bound. For example, suppose that it should be between 1 and 4 seconds: +._Java-only: mock endpoint arrival time range expectations_ [source,java] ---- mock.message(1).arrives().between(1, 4).seconds().afterPrevious(); @@ -522,6 +543,7 @@ mock.message(1).arrives().between(1, 4).seconds().afterPrevious(); You can also set the expectation on all messages, for example, to say that the gap between them should be at most 1 second: +._Java-only: mock endpoint arrival time expectations for all messages_ [source,java] ---- mock.allMessages().arrives().noLaterThan(1).seconds().beforeNext(); diff --git a/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc b/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc index 97e6b4a25039..12023945fded 100644 --- a/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc +++ b/components/camel-test/camel-test-junit5/src/main/docs/test-junit5.adoc @@ -21,6 +21,7 @@ for build the routes to be tested. Then the methods with `@Test` annotations are will be executed. The base class `CamelTestSupport` has a number of helper methods to configure testing, see more at the Javadoc of this class. +._Java-only: CamelTestSupport is a Java test framework class._ [source,java] ---- import org.apache.camel.RoutesBuilder; @@ -112,6 +113,7 @@ configuration is done inside them. Consider, for instance, a test enabling JMX. Previously, that test would be written like this: +._Java-only: overriding CamelTestSupport methods is Java-specific._ [source,java] ---- public class MyTestClass extends CamelTestSupport { @@ -128,6 +130,7 @@ public class MyTestClass extends CamelTestSupport { This test can be migrated to the new API like this: +._Java-only: CamelTestSupport configuration API is Java-specific._ [source,java] ---- public class MyTestClass extends CamelTestSupport { diff --git a/components/camel-test/camel-test-main-junit5/src/main/docs/test-main-junit5.adoc b/components/camel-test/camel-test-main-junit5/src/main/docs/test-main-junit5.adoc index a7a2cfb00c88..6ea12625fa1e 100644 --- a/components/camel-test/camel-test-main-junit5/src/main/docs/test-main-junit5.adoc +++ b/components/camel-test/camel-test-main-junit5/src/main/docs/test-main-junit5.adoc @@ -704,6 +704,7 @@ In the next example, the property `some-property` is set to `foo` for all the tests in `SomeTest` including the tests in `SomeNestedTest`. Additionally, the property `some-other-property` is set to `bar` but only for all the tests in `SomeNestedTest`. +._Java-only: annotation-based nested test configuration_ [source,java] ---- @CamelMainTest(properties = { "some-property=foo" }) @@ -727,6 +728,7 @@ but also the tests in the `@Nested` test class `SomeOtherNestedTest` as it is no `SomeOtherMainClass` is used as the main class for all the tests directly inside `SomeNestedTest`, but also the tests in the `@Nested` test class `SomeDeeplyNestedTest` as it is not redefined. +._Java-only: annotation-based nested test class hierarchy_ [source,java] ---- @CamelMainTest(mainClass = SomeMainClass.class) diff --git a/components/camel-test/camel-test-main-junit6/src/main/docs/test-main-junit6.adoc b/components/camel-test/camel-test-main-junit6/src/main/docs/test-main-junit6.adoc index d7270866c0b0..a07f06bbe8bf 100644 --- a/components/camel-test/camel-test-main-junit6/src/main/docs/test-main-junit6.adoc +++ b/components/camel-test/camel-test-main-junit6/src/main/docs/test-main-junit6.adoc @@ -704,6 +704,7 @@ In the next example, the property `some-property` is set to `foo` for all the tests in `SomeTest` including the tests in `SomeNestedTest`. Additionally, the property `some-other-property` is set to `bar` but only for all the tests in `SomeNestedTest`. +._Java-only: JUnit 6 nested test class with @CamelMainTest annotation_ [source,java] ---- @CamelMainTest(properties = { "some-property=foo" }) @@ -727,6 +728,7 @@ but also the tests in the `@Nested` test class `SomeOtherNestedTest` as it is no `SomeOtherMainClass` is used as the main class for all the tests directly inside `SomeNestedTest`, but also the tests in the `@Nested` test class `SomeDeeplyNestedTest` as it is not redefined. +._Java-only: JUnit 6 nested test class with mono-valued @CamelMainTest attribute override_ [source,java] ---- @CamelMainTest(mainClass = SomeMainClass.class) diff --git a/components/camel-test/camel-test-spring-junit5/src/main/docs/test-spring-junit5.adoc b/components/camel-test/camel-test-spring-junit5/src/main/docs/test-spring-junit5.adoc index 69685ed31838..b9c86aab313d 100644 --- a/components/camel-test/camel-test-spring-junit5/src/main/docs/test-spring-junit5.adoc +++ b/components/camel-test/camel-test-spring-junit5/src/main/docs/test-spring-junit5.adoc @@ -26,6 +26,7 @@ The Spring test context may be specified in one of three ways: * a class annotated with `SpringBootConfiguration` accessible in the package of the test class or a parent package. +._Java-only: Spring Boot test using annotations, dependency injection, and inner configuration class._ [source,java] ---- package com.foo; @@ -82,6 +83,7 @@ class CamelSpringBootSimpleTest { There are multiple approaches to test Camel Spring 5.x based routes with JUnit 5. An approach is to extend `org.apache.camel.test.spring.junit5.CamelSpringTestSupport`, for instance: +._Java-only: extends CamelSpringTestSupport which is a Java test base class._ [source,java] ---- public class SimpleMockTest extends CamelSpringTestSupport { @@ -118,6 +120,7 @@ Instead of instantiating the `CamelContext` and routes programmatically, this class relies on a Spring context to wire the needed components together. If your test extends this class, you must provide the Spring context by implementing the following method: +._Java-only: abstract method to override in Java test subclasses._ [source,java] ---- protected abstract AbstractApplicationContext createApplicationContext(); @@ -128,6 +131,7 @@ protected abstract AbstractApplicationContext createApplicationContext(); A better and recommended approach involves the usage of the `org.apache.camel.test.spring.junit5.CamelSpringTest` annotation, as shown: +._Java-only: Spring test using annotations and dependency injection._ [source,java] ---- package com.foo; diff --git a/components/camel-test/camel-test-spring-junit6/src/main/docs/test-spring-junit6.adoc b/components/camel-test/camel-test-spring-junit6/src/main/docs/test-spring-junit6.adoc index a867418d6e6c..4733c25fb77e 100644 --- a/components/camel-test/camel-test-spring-junit6/src/main/docs/test-spring-junit6.adoc +++ b/components/camel-test/camel-test-spring-junit6/src/main/docs/test-spring-junit6.adoc @@ -26,6 +26,7 @@ The Spring test context may be specified in one of three ways: * a class annotated with `SpringBootConfiguration` accessible in the package of the test class or a parent package. +._Java-only: uses Java test annotations and Spring Boot configuration class._ [source,java] ---- package com.foo; @@ -82,6 +83,7 @@ class CamelSpringBootSimpleTest { There are multiple approaches to test Camel Spring 4.x based routes with JUnit 6. An approach is to extend `org.apache.camel.test.spring.junit6.CamelSpringTestSupport`, for instance: +._Java-only: extends CamelSpringTestSupport, a Java test base class._ [source,java] ---- public class SimpleMockTest extends CamelSpringTestSupport { @@ -117,6 +119,7 @@ Instead of instantiating the `CamelContext` and routes programmatically, this class relies on a Spring context to wire the needed components together. If your test extends this class, you must provide the Spring context by implementing the following method: +._Java-only: Java method signature for Spring context creation._ [source,java] ---- protected abstract AbstractApplicationContext createApplicationContext(); @@ -127,6 +130,7 @@ protected abstract AbstractApplicationContext createApplicationContext(); A better and recommended approach involves the usage of the `org.apache.camel.test.spring.junit6.CamelSpringTest` annotation, as shown: +._Java-only: uses Java test annotations and Spring dependency injection._ [source,java] ---- package com.foo; diff --git a/components/camel-xpath/src/main/docs/xpath-language.adoc b/components/camel-xpath/src/main/docs/xpath-language.adoc index 0f5a4aed38ee..e0d6134bc1f5 100644 --- a/components/camel-xpath/src/main/docs/xpath-language.adoc +++ b/components/camel-xpath/src/main/docs/xpath-language.adoc @@ -255,6 +255,8 @@ XPath which result type to use. In Java DSL: +._Java-only: XPath expression builder API_ + [source,java] ---- xpath("/foo:person/@id", String.class) @@ -294,6 +296,8 @@ header's value, you can do this by defining the 'headerName' attribute. And in Java DSL you specify the headerName as the second parameter as shown: +._Java-only: XPath expression builder API_ + [source,java] ---- xpath("/invoice/@orderType = 'premium'", "invoiceDetails") @@ -617,6 +621,8 @@ You can enable this option in Java DSL and XML DSL: Java DSL: +._Java-only: XPathBuilder API_ + [source,java] ---- XPathBuilder.xpath("/foo:person/@id", String.class).logNamespaces()
