Class FormInstanceManager

All Implemented Interfaces:
Peer

public class FormInstanceManager extends ProtoableNode
  • Constructor Details

    • FormInstanceManager

      public FormInstanceManager(Element parent, Node prevSibling)
  • Method Details

    • setInstances

      public void setInstances(int nNumber, boolean bThrow)
      Add or remove instances of an Subform or SubformSet child of this XFAForm node. This method will automatically ensure that no occurrence or hierarchy rules are invalidated. During a remove data nodes are unmapped and during an add data is automatically merged into the new instances. This method will also recursively add/remove the children of the new node.
      Parameters:
      nNumber - the number of instances of this subform that we want to have
      bThrow - if true, an exception will be throw if nNumber is not a valid number of occurrences.
    • addInstance

      public Node addInstance(boolean bMerge)
      Add an instance of a Subform or SubformSet to this Form node. This method will automatically ensure that no occurrence or hierarchy rules are invalidated. This method will also recursively add the children of the new node.
      Parameters:
      bMerge - if true attempt to merge the new Form node against the XFA-Data DOM.
      Returns:
      a null Node if no node was added, else the newly created Form node.
    • removeInstance

      public void removeInstance(int nInstance, boolean bNotifyPeers)
      Remove a Subform or SubformSet from this Form node. This method will automatically ensure that no occurrence rules are invalidated and the data is removed from the XFA-Data DOM.
      Parameters:
      nInstance - the instance to remove.
    • moveInstance

      public void moveInstance(int nInstance, int nPosition, boolean bNotify)
      Move a child of this Form node and the corresponding data in the XFA-Data DOM. This method will automatically ensure that no occurrence or hierarchy rules are invalidated.
      Parameters:
      nInstance - the instance to be moved.
      nPosition - the position of the child within its instances (0 based).
    • setInstanceListener

      public void setInstanceListener(FormInstanceManager.InstanceListener listener)
      Register an instance listener to this manager. This listener will be notified of instances being added/removed/moved
    • getDeltas

      public void getDeltas(Element delta, XFAList list)
      Description copied from class: Element
      Gets a collection of deltas to restore. The locale attribute is always restored immediately, and is not returned in the list of deltas.
      Overrides:
      getDeltas in class Element
      Parameters:
      delta - an Element from the form packet.
      list - the list of deltas to be populated.
    • getScriptTable

      public ScriptTable getScriptTable()
      Overrides:
      getScriptTable in class ProtoableNode
    • setMatchDescendantsOnly

      public void setMatchDescendantsOnly(boolean bDescendantsOnly)
    • getMatchDescendantsOnly

      public boolean getMatchDescendantsOnly()