Class ForEachChildElementPipe

All Implemented Interfaces:
HasSender, HasTransactionAttribute, IConfigurable, IConfigurationAware, IForwardTarget, INamedObject, IPipe, IScopeProvider, IWithParameters, EventThrowing, HasStatistics, IThreadCreator, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Category(BASIC) public class ForEachChildElementPipe extends StringIteratorPipe implements IThreadCreator
Sends a message to a Sender for each child element of the input XML. Input can be a String containing XML, a filename (set processFile true), an InputStream or a Reader.
Since:
4.6.1
Author:
Gerrit van Brakel
Parameters
all parameters will be applied to the xslt if an elementXPathExpression is specified
  • Field Details

  • Constructor Details

    • ForEachChildElementPipe

      public ForEachChildElementPipe()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from class: FixedForwardPipe
      checks for correct configuration of forward
      Specified by:
      configure in interface IConfigurable
      Specified by:
      configure in interface IPipe
      Overrides:
      configure in class StringIteratorPipe
      Throws:
      ConfigurationException
    • start

      public void start()
      Description copied from interface: IPipe
      Perform necessary action to start the pipe. This method is executed after the IPipe.configure() method, for each start and stop command of the adapter.
      Specified by:
      start in interface IPipe
      Overrides:
      start in class MessageSendingPipe
    • stop

      public void stop()
      Description copied from interface: IPipe
      Perform necessary actions to stop the Pipe.
      For instance, closing JMS connections, DBMS connections etc.
      Specified by:
      stop in interface IPipe
      Overrides:
      stop in class MessageSendingPipe
    • makeEncapsulatingXslt

      protected String makeEncapsulatingXslt(String rootElementname, String xpathExpression, int xsltVersion, String namespaceDefs)
    • createHandler

      protected void createHandler(org.frankframework.pipes.ForEachChildElementPipe.HandlerRecord result, ThreadConnector<?> threadConnector, Message input, PipeLineSession session, IteratingPipe<String>.ItemCallback callback) throws TransformerConfigurationException
      Throws:
      TransformerConfigurationException
    • iterateOverInput

      protected IteratingPipe.StopReason iterateOverInput(Message input, PipeLineSession session, Map<String,Object> threadContext, IteratingPipe<String>.ItemCallback callback) throws SenderException, TimeoutException
      Overrides:
      iterateOverInput in class IteratingPipe<String>
      Throws:
      SenderException
      TimeoutException
    • getExtractElementsTp

      protected TransformerPool getExtractElementsTp()
    • setProcessFile

      @Deprecated(forRemoval=true, since="7.7.0") @ConfigurationWarning("Please add a LocalFileSystemPipe with action=read in front of this pipe instead") public void setProcessFile(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      When set true, the input is assumed to be the name of a file to be processed. Otherwise, the input itself is transformed. The character encoding will be read from the XML declaration
      Default value
      false
    • setContainerElement

      public void setContainerElement(String containerElement)
      Element name (not an XPath-expression), qualified via attribute namespaceDefs, used to determine the 'root' of elements to be iterated over, i.e. the root of the set of child elements. When empty, the pipe will iterate over each direct child element of the root
    • setTargetElement

      public void setTargetElement(String targetElement)
      Element name (not an XPath-expression), qualified via attribute namespaceDefs, used to determine the type of elements to be iterated over, i.e. the element name of each of the child elements. When empty, the pipe will iterate over any direct child element of the root or specified containerElement
    • setElementXPathExpression

      public void setElementXPathExpression(String string)
      XPath-expression used to determine the set of elements to be iterated over, i.e. the set of child elements. When empty, the effective value is \/*\/*, i.e. the pipe will iterate over each direct child element of the root. Be aware that memory consumption appears to increase with file size when this attribute is used. When possible, use containerElement and/or targetElement instead.
    • setXsltVersion

      public void setXsltVersion(int xsltVersion)
      If set to 2 or 3 a Saxon (net.sf.saxon) XSLT processor 2.0 or 3.0 will be used, supporting XPath 2.0 or 3.0 respectively, otherwise an XSLT processor 1.0 (org.apache.xalan), supporting XPath 1.0. N.B. Be aware that setting this other than 1 might cause the input file being read as a whole in to memory, as XSLT Streaming is currently only supported by the XSLT Processor that is used for xsltVersion=1
      Default value
      1
    • setRemoveNamespaces

      public void setRemoveNamespaces(boolean b)
      If set true namespaces (and prefixes) are removed from the items just before forwarding them to the sender. N.B. This takes place after the transformation for elementXPathExpression if that is specified
    • isProcessFile

      public boolean isProcessFile()
    • getContainerElement

      public String getContainerElement()
    • getTargetElement

      public String getTargetElement()
    • getElementXPathExpression

      public String getElementXPathExpression()
    • getXsltVersion

      public int getXsltVersion()
    • isRemoveNamespaces

      public boolean isRemoveNamespaces()
    • setThreadLifeCycleEventListener

      public void setThreadLifeCycleEventListener(ThreadLifeCycleEventListener<Object> threadLifeCycleEventListener)
      Specified by:
      setThreadLifeCycleEventListener in interface IThreadCreator
    • setTxManager

      public void setTxManager(IThreadConnectableTransactionManager<?,?> txManager)
    • getXmlDebugger

      public IXmlDebugger getXmlDebugger()
    • setXmlDebugger

      public void setXmlDebugger(IXmlDebugger xmlDebugger)