Class EvaluateXPath
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.EvaluateXPath
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@Tags({"XML","evaluate","XPath"})
@InputRequirement(INPUT_REQUIRED)
@CapabilityDescription("Evaluates one or more XPaths against the content of a FlowFile. The results of those XPaths are assigned to FlowFile Attributes or are written to the content of the FlowFile itself, depending on configuration of the Processor. XPaths are entered by adding user-defined properties; the name of the property maps to the Attribute Name into which the result will be placed (if the Destination is flowfile-attribute; otherwise, the property name is ignored). The value of the property must be a valid XPath expression. If the XPath evaluates to more than one node and the Return Type is set to \'nodeset\' (either directly, or via \'auto-detect\' with a Destination of \'flowfile-content\'), the FlowFile will be unmodified and will be routed to failure. If the XPath does not evaluate to a Node, the FlowFile will be routed to \'unmatched\' without having its contents modified. If Destination is flowfile-attribute and the expression matches nothing, attributes will be created with empty strings as the value, and the FlowFile will always be routed to \'matched\'")
@WritesAttribute(attribute="user-defined",
description="This processor adds user-defined attributes if the <Destination> property is set to flowfile-attribute.")
@DynamicProperty(name="A FlowFile attribute(if <Destination> is set to \'flowfile-attribute\'",
value="An XPath expression",
description="If <Destination>=\'flowfile-attribute\' then the FlowFile attribute is set to the result of the XPath Expression. If <Destination>=\'flowfile-content\' then the FlowFile content is set to the result of the XPath Expression.")
@SystemResourceConsiderations(@SystemResourceConsideration(resource=MEMORY,description="Processing requires reading the entire FlowFile into memory"))
public class EvaluateXPath
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringprivate final AtomicReference<XPathFactory> private static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) Set<org.apache.nifi.processor.Relationship> protected org.apache.nifi.components.PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) protected List<org.apache.nifi.components.PropertyDescriptor> voidvoidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
DESTINATION_ATTRIBUTE
- See Also:
-
DESTINATION_CONTENT
- See Also:
-
RETURN_TYPE_AUTO
- See Also:
-
RETURN_TYPE_NODESET
- See Also:
-
RETURN_TYPE_STRING
- See Also:
-
DESTINATION
public static final org.apache.nifi.components.PropertyDescriptor DESTINATION -
RETURN_TYPE
public static final org.apache.nifi.components.PropertyDescriptor RETURN_TYPE -
VALIDATE_DTD
public static final org.apache.nifi.components.PropertyDescriptor VALIDATE_DTD -
PROPERTY_DESCRIPTORS
-
REL_MATCH
public static final org.apache.nifi.processor.Relationship REL_MATCH -
REL_NO_MATCH
public static final org.apache.nifi.processor.Relationship REL_NO_MATCH -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
RELATIONSHIPS
-
factoryRef
-
-
Constructor Details
-
EvaluateXPath
public EvaluateXPath()
-
-
Method Details
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
initializeXPathFactory
@OnScheduled public void initializeXPathFactory() -
getSupportedDynamicPropertyDescriptor
protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) - Overrides:
getSupportedDynamicPropertyDescriptorin classorg.apache.nifi.components.AbstractConfigurableComponent
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor
-