public final class ProcessorDefinitionHelper extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Collection<T> |
filterTypeInOutputs(List<ProcessorDefinition<?>> outputs,
Class<T> type)
Looks for the given type in the list of outputs and recurring all the children as well.
|
static <T> Collection<T> |
filterTypeInOutputs(List<ProcessorDefinition<?>> outputs,
Class<T> type,
int maxDeep)
Looks for the given type in the list of outputs and recurring all the children as well.
|
static <T extends ProcessorDefinition> |
findFirstParentOfType(Class<T> parentType,
ProcessorDefinition<?> node,
boolean recursive)
Is the given node parent(s) of the given type
|
static <T> T |
findFirstTypeInOutputs(List<ProcessorDefinition<?>> outputs,
Class<T> type)
Looks for the given type in the list of outputs and recurring all the children as well.
|
static Set<String> |
gatherAllNodeIds(ProcessorDefinition<?> node,
Set<String> set,
boolean onlyCustomId,
boolean includeAbstract)
Traverses the node, including its children (recursive), and gathers all the node ids.
|
static RouteDefinition |
getRoute(org.apache.camel.NamedNode node)
Gets the route definition the given node belongs to.
|
static String |
getRouteId(org.apache.camel.NamedNode node)
Gets the route id the given node belongs to.
|
static boolean |
isFirstChildOfType(Class<?> parentType,
ProcessorDefinition<?> node)
Is the given child the first in the outputs from the parent?
|
static boolean |
isParentOfType(Class<? extends ProcessorDefinition> parentType,
ProcessorDefinition<?> node,
boolean recursive)
Is the given node parent(s) of the given type
|
static void |
resetAllAutoAssignedNodeIds(ProcessorDefinition<?> node)
Resets (nulls) all the auto assigned ids on the node and the nested children (outputs)
|
public static <T> Collection<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type)
outputs
- list of outputs, can be null or empty.type
- the type to look forpublic static <T> Collection<T> filterTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type, int maxDeep)
outputs
- list of outputs, can be null or empty.type
- the type to look formaxDeep
- maximum levels deep to traversepublic static <T> T findFirstTypeInOutputs(List<ProcessorDefinition<?>> outputs, Class<T> type)
outputs
- list of outputs, can be null or empty.type
- the type to look forpublic static boolean isFirstChildOfType(Class<?> parentType, ProcessorDefinition<?> node)
parentType
- the type the parent must benode
- the nodepublic static boolean isParentOfType(Class<? extends ProcessorDefinition> parentType, ProcessorDefinition<?> node, boolean recursive)
parentType
- the parent typenode
- the current noderecursive
- whether or not to check grand parent(s) as wellpublic static <T extends ProcessorDefinition> T findFirstParentOfType(Class<T> parentType, ProcessorDefinition<?> node, boolean recursive)
parentType
- the parent typenode
- the current noderecursive
- whether or not to check grand parent(s) as wellpublic static RouteDefinition getRoute(org.apache.camel.NamedNode node)
node
- the nodepublic static String getRouteId(org.apache.camel.NamedNode node)
node
- the nodepublic static Set<String> gatherAllNodeIds(ProcessorDefinition<?> node, Set<String> set, boolean onlyCustomId, boolean includeAbstract)
node
- the target nodeset
- set to store ids, if null a new set will be createdonlyCustomId
- whether to only store custom assigned ids (ie.
OptionalIdentifiedDefinition.hasCustomIdAssigned()
includeAbstract
- whether to include abstract nodes (ie.
ProcessorDefinition.isAbstract()
public static void resetAllAutoAssignedNodeIds(ProcessorDefinition<?> node)
Apache Camel