java.lang.Object
com.deltaxml.core.config.subtreeProcessing.Subtree

public class Subtree extends Object
This class configures elements based on how they need to be processed.
  • Constructor Details

    • Subtree

      public Subtree(String elemXpath, SubtreeMode mode)
      Initialises a subtree with both element XPath and mode.
      Parameters:
      elemXpath - The XPath string representing the element location.
      mode - The SubtreeMode used to identify content type for the subtree.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • Subtree

      public Subtree(String elemXpath, SubtreeMode mode, Boolean ordered)
      Initialises a subtree with element XPath, mode and ordered.
      Parameters:
      elemXpath - The XPath string representing the element location.
      mode - The SubtreeMode used to identify content type for the subtree.
      ordered - The boolean where true represents ordered alignment, and false represents unordered alignment.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • Subtree

      public Subtree(String elemXpath, Boolean ordered)
      Initialises a subtree with both element XPath and ordered.
      Parameters:
      elemXpath - The XPath string representing the element location.
      ordered - The boolean where true represents ordered alignment, and false represents unordered alignment.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • Subtree

      public Subtree(String elemXpath, Boolean ordered, List<ChildAlignment> childAlignments)
      Initialises a subtree with both element XPath and ordered along with the child alignment list.
      Parameters:
      elemXpath - The XPath string representing the element location.
      ordered - The boolean where true represents ordered alignment, and false represents unordered alignment.
      childAlignments - The list of ChildAlignment instances specifying children for alignment.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • Subtree

      public Subtree(String elemXpath, SubtreeMode mode, Boolean ordered, List<ChildAlignment> childAlignments)
      Initialises a subtree with element XPath, mode and ordered along with the child alignment list.
      Parameters:
      elemXpath - The XPath string representing the element location.
      mode - The SubtreeMode used to identify content type for the subtree.
      ordered - The boolean where true represents ordered alignment, and false represents unordered alignment.
      childAlignments - The list of ChildAlignment instances specifying children for alignment.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • Subtree

      public Subtree(String elemXpath)
      Initialises a subtree with only an element XPath. The mode in which the subtree will be processed is the default mode for the file.
      Parameters:
      elemXpath - The Subtree element XPath.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
  • Method Details

    • getElemXpath

      public String getElemXpath()
      Gets the Subtree element XPath.
      Returns:
      An element XPath used to identify the subtree.
    • setElemXpath

      public void setElemXpath(String elemXpath)
      Sets the element XPath.
      Parameters:
      elemXpath - An XPath used to identify the subtree.
      Throws:
      IllegalArgumentException - if passed elemXpath is invalid.
    • getMode

      public SubtreeMode getMode()
      Gets the Subtree element mode.
      Returns:
      The SubtreeMode used to identify content type for the subtree.
    • setMode

      public void setMode(SubtreeMode mode)
      Sets the element mode.
      Parameters:
      mode - The SubtreeMode used to identify content type for the subtree.
    • getChildAlignments

      public List<ChildAlignment> getChildAlignments()
      Gets the list of all children alignment specifiers.
      Returns:
      The list of ChildAlignment instances specifying children for alignment.
    • setChildAlignments

      public void setChildAlignments(List<ChildAlignment> childAlignments)
      Sets the list for children alignment specifiers.
      Parameters:
      childAlignments - The list of ChildAlignment instances specifying children for alignment.
    • addChildAlignment

      public void addChildAlignment(ChildAlignment childAlignment)
      Adds to the list of children alignments.
      Parameters:
      childAlignment - The ChildAlignment to be added to the existing list of children alignment specifiers.
    • isOrdered

      public Boolean isOrdered()
      Returns the ordered alignment value.
      Returns:
      The boolean where true represents ordered alignment, and false represents unordered alignment.
    • setOrdered

      public void setOrdered(Boolean ordered)
      Sets the ordered alignment value.
      Parameters:
      ordered - The boolean where true represents ordered alignment, and false represents unordered alignment.