Class PersistentFileTransaction

java.lang.Object
org.dellroad.stuff.pobj.PersistentFileTransaction

public class PersistentFileTransaction extends Object
Represents an open "transaction" on a PersistentObject's persistent file.

This class is used by PersistentObjectSchemaUpdater and would normally not be used directly.

  • Constructor Details

  • Method Details

    • getData

      public Document getData()
      Get the current XML data. Does not include the XML update list.

      During a schema update the caller may modify the document in place, or invoke setData(org.w3c.dom.Document) to completely replace it.

      Returns:
      XML data
    • setData

      public void setData(Document data)
      Change the current XML data.

      This would be invoked by a schema update if it wanted to completely replace the XML document, rather than just modifying it in place.

      Parameters:
      data - new XML data; does not include the XML update list
    • getSystemId

      public String getSystemId()
      Get the system ID of the original source input.
      Returns:
      XML system ID
    • getUpdates

      public List<String> getUpdates()
      Get the updates list associated with this transaction.
      Returns:
      list of updates
    • transform

      public void transform(Transformer transformer) throws TransformerException
      Apply an XSLT transform to the current XML object in this transaction.

      This is an alternative to modifying the DOM, when XSL is a simpler way to perform the update.

      Parameters:
      transformer - XSLT transformer
      Throws:
      IllegalStateException - if the current root object is null
      PersistentObjectException - if an error occurs
      TransformerException - if the transformation fails
    • toString

      public String toString()
      Overrides:
      toString in class Object