Class EvaluateXQuery

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.EvaluateXQuery
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SideEffectFree @SupportsBatching @Tags({"XML","evaluate","XPath","XQuery"}) @InputRequirement(INPUT_REQUIRED) @CapabilityDescription("Evaluates one or more XQueries against the content of a FlowFile. The results of those XQueries are assigned to FlowFile Attributes or are written to the content of the FlowFile itself, depending on configuration of the Processor. XQueries 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 XQuery. If the XQuery returns more than one result, new attributes or FlowFiles (for Destinations of \'flowfile-attribute\' or \'flowfile-content\' respectively) will be created for each result (attributes will have a \'.n\' one-up number appended to the specified attribute name). If any provided XQuery returns a result, the FlowFile(s) will be routed to \'matched\'. If no provided XQuery returns a result, the FlowFile will be routed to \'unmatched\'. If the Destination is \'flowfile-attribute\' and the XQueries matche nothing, no attributes will be applied to the FlowFile.") @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 XQuery", description="If <Destination>=\'flowfile-attribute\' then the FlowFile attribute is set to the result of the XQuery. If <Destination>=\'flowfile-content\' then the FlowFile content is set to the result of the XQuery.") @SystemResourceConsiderations(@SystemResourceConsideration(resource=MEMORY,description="Processing requires reading the entire FlowFile into memory")) public class EvaluateXQuery extends org.apache.nifi.processor.AbstractProcessor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Collection<org.apache.nifi.components.ValidationResult>
    customValidate(org.apache.nifi.components.ValidationContext context)
     
    private String
    formatItem(net.sf.saxon.s9api.XdmItem item, org.apache.nifi.processor.ProcessContext context)
     
    Set<org.apache.nifi.processor.Relationship>
     
    protected org.apache.nifi.components.PropertyDescriptor
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     
    (package private) void
    writeFormattedItem(net.sf.saxon.s9api.XdmItem item, org.apache.nifi.processor.ProcessContext context, OutputStream out)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • DESTINATION_ATTRIBUTE

      public static final String DESTINATION_ATTRIBUTE
      See Also:
    • DESTINATION_CONTENT

      public static final String DESTINATION_CONTENT
      See Also:
    • OUTPUT_METHOD_XML

      public static final String OUTPUT_METHOD_XML
      See Also:
    • OUTPUT_METHOD_HTML

      public static final String OUTPUT_METHOD_HTML
      See Also:
    • OUTPUT_METHOD_TEXT

      public static final String OUTPUT_METHOD_TEXT
      See Also:
    • DESTINATION

      public static final org.apache.nifi.components.PropertyDescriptor DESTINATION
    • XML_OUTPUT_METHOD

      public static final org.apache.nifi.components.PropertyDescriptor XML_OUTPUT_METHOD
    • XML_OUTPUT_OMIT_XML_DECLARATION

      public static final org.apache.nifi.components.PropertyDescriptor XML_OUTPUT_OMIT_XML_DECLARATION
    • XML_OUTPUT_INDENT

      public static final org.apache.nifi.components.PropertyDescriptor XML_OUTPUT_INDENT
    • VALIDATE_DTD

      public static final org.apache.nifi.components.PropertyDescriptor VALIDATE_DTD
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> 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

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
  • Constructor Details

    • EvaluateXQuery

      public EvaluateXQuery()
  • Method Details

    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context)
      Overrides:
      customValidate in class org.apache.nifi.components.AbstractConfigurableComponent
    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • getSupportedDynamicPropertyDescriptor

      protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
      Overrides:
      getSupportedDynamicPropertyDescriptor in class org.apache.nifi.components.AbstractConfigurableComponent
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
    • formatItem

      private String formatItem(net.sf.saxon.s9api.XdmItem item, org.apache.nifi.processor.ProcessContext context) throws IOException
      Throws:
      IOException
    • writeFormattedItem

      void writeFormattedItem(net.sf.saxon.s9api.XdmItem item, org.apache.nifi.processor.ProcessContext context, OutputStream out) throws IOException
      Throws:
      IOException