Package org.apache.camel.builder
Class AdviceWithBuilder<T extends ProcessorDefinition<?>>
- java.lang.Object
-
- org.apache.camel.builder.AdviceWithBuilder<T>
-
public class AdviceWithBuilder<T extends ProcessorDefinition<?>> extends Object
A builder when using the advice with feature.- See Also:
AdviceWith
-
-
Constructor Summary
Constructors Constructor Description AdviceWithBuilder(AdviceWithRouteBuilder builder, String id, String toString, String toUri, Class<T> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessorDefinition<?>
after()
Insert the following node(s) after the matched node(s)ProcessorDefinition<?>
before()
Insert the following node(s) before the matched node(s)AdviceWithBuilder<T>
maxDeep(int maxDeep)
Will only apply for nodes maximum levels deep.void
remove()
Removes the matched node(s)ProcessorDefinition<?>
replace()
Replaces the matched node(s) with the following nodes.AdviceWithBuilder<T>
selectFirst()
Will only apply the first node matched.AdviceWithBuilder<T>
selectIndex(int index)
Will only apply the n'th node matched.AdviceWithBuilder<T>
selectLast()
Will only apply the last node matched.AdviceWithBuilder<T>
selectRange(int from, int to)
Will only apply the node in the index range matched.
-
-
-
Method Detail
-
selectFirst
public AdviceWithBuilder<T> selectFirst()
Will only apply the first node matched.- Returns:
- the builder to build the nodes.
-
selectLast
public AdviceWithBuilder<T> selectLast()
Will only apply the last node matched.- Returns:
- the builder to build the nodes.
-
selectIndex
public AdviceWithBuilder<T> selectIndex(int index)
Will only apply the n'th node matched.- Parameters:
index
- index of node to match (is 0-based)- Returns:
- the builder to build the nodes.
-
selectRange
public AdviceWithBuilder<T> selectRange(int from, int to)
Will only apply the node in the index range matched.- Parameters:
from
- from index of node to start matching (inclusive)to
- to index of node to stop matching (inclusive)- Returns:
- the builder to build the nodes.
-
maxDeep
public AdviceWithBuilder<T> maxDeep(int maxDeep)
Will only apply for nodes maximum levels deep. The first level is 1, and level 2 is the children of the first level nodes, and so on. Use zero or negative value for unbounded level.- Parameters:
maxDeep
- the maximum levels to traverse deep in the Camel route tree.- Returns:
- the builder to build the nodes.
-
replace
public ProcessorDefinition<?> replace()
Replaces the matched node(s) with the following nodes.- Returns:
- the builder to build the nodes.
-
remove
public void remove()
Removes the matched node(s)
-
before
public ProcessorDefinition<?> before()
Insert the following node(s) before the matched node(s)- Returns:
- the builder to build the nodes.
-
after
public ProcessorDefinition<?> after()
Insert the following node(s) after the matched node(s)- Returns:
- the builder to build the nodes.
-
-