Class AddDOMNode

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class AddDOMNode
    extends AbstractTransformer
    Adds a new node below the incoming org.w3c.dom.Node and forwards the new node.
    In case of an incoming org.w3c.dom.Document, the node gets added below the root node.

    Input/output:
    - accepts:
       org.w3c.dom.Document
       org.w3c.dom.Node
    - generates:
       org.w3c.dom.Node


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: AddDOMNode
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -node-name <java.lang.String> (property: nodeName)
        The name of the node to add.
        default: node
     
    -has-value <boolean> (property: hasValue)
        If enabled, the node gets the specified textual value.
        default: false
     
    -node-value <java.lang.String> (property: nodeValue)
        The value of the node to add; new lines, carriage returns or tabs can be 
        escaped like '\n', '\r' or '\t'.
        default: 
     
    Version:
    $Revision: 8036 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_NodeName

        protected String m_NodeName
        the name of the node to add.
      • m_HasValue

        protected boolean m_HasValue
        whether the node has a (textual) value.
      • m_NodeValue

        protected String m_NodeValue
        the node value.
    • Constructor Detail

      • AddDOMNode

        public AddDOMNode()
    • Method Detail

      • setNodeName

        public void setNodeName​(String value)
        Sets the name of the node to add.
        Parameters:
        value - the name
      • getNodeName

        public String getNodeName()
        Returns the name of the node to add.
        Returns:
        the name
      • nodeNameTipText

        public String nodeNameTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHasValue

        public void setHasValue​(boolean value)
        Sets whether the node has a textual value.
        Parameters:
        value - true if textual value
      • getHasValue

        public boolean getHasValue()
        Returns whether the node has a textual value.
        Returns:
        true if textual value
      • hasValueTipText

        public String hasValueTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNodeValue

        public void setNodeValue​(String value)
        Sets the value of the node to add.
        Parameters:
        value - the value
      • getNodeValue

        public String getNodeValue()
        Returns the value of the node to add.
        Returns:
        the value
      • nodeValueTipText

        public String nodeValueTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        the Class of objects that can be processed
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        the Class of the generated tokens
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message