Structured Text Toolkit

com.saelist.stx.operators
Class SplitOperator

java.lang.Object
  extended bycom.saelist.stx.operators.AbstractOperator
      extended bycom.saelist.stx.operators.SplitOperator
All Implemented Interfaces:
Operator

public class SplitOperator
extends AbstractOperator

See Operator for general description of the Operator concept in stx.

If the pair's text contains pattern then the text to the right of the pattern is moved to a new child and only the text to the left of the pattern remains with the original pair. If the pair already had children the new child is inserted in front of them. For example, split on "//*" with pattern = ".*:.*" will transform the structure


   person
     name : John
     tel : 123


into

   person
     name
       John
     tel
       123


Field Summary
 
Fields inherited from class com.saelist.stx.operators.AbstractOperator
config, logger
 
Constructor Summary
SplitOperator()
           
 
Method Summary
 void init()
          Descendants should overide this if they vant to cache elements of config in member variables or do some other inital setup.
 void operate(Pair pair)
          Performs the split operation on the given pair.
 
Methods inherited from class com.saelist.stx.operators.AbstractOperator
init, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitOperator

public SplitOperator()
Method Detail

init

public void init()
Description copied from class: AbstractOperator
Descendants should overide this if they vant to cache elements of config in member variables or do some other inital setup.

Overrides:
init in class AbstractOperator

operate

public void operate(Pair pair)
Performs the split operation on the given pair.

Specified by:
operate in interface Operator
Specified by:
operate in class AbstractOperator

Structured Text Toolkit