Class ReferenceChangeTracker


  • public class ReferenceChangeTracker
    extends Object
    Simple helper class that can be used to keep track of uuid mappings (e.g. if the uuid of an imported or copied node is mapped to a new uuid) and processed (e.g. imported or copied) reference properties that might need correcting depending on the uuid mappings.
    • Constructor Detail

      • ReferenceChangeTracker

        public ReferenceChangeTracker()
        Creates a new instance.
    • Method Detail

      • clear

        public void clear()
        Resets all internal state.
      • mappedUUIDs

        public void mappedUUIDs​(String oldUUID,
                                String newUUID)
        Store the given uuid mapping for later lookup using #adjustReferences(UpdatableItemStateManager, ItemStateValidator).
        Parameters:
        oldUUID -
        newUUID -
      • getMappedReference

        public QValue getMappedReference​(QValue oldReference,
                                         QValueFactory factory)
        Returns the new UUID to which oldUUID has been mapped or null if no such mapping exists.
        Parameters:
        oldReference - old uuid represented by the given QValue.
        factory -
        Returns:
        mapped new QValue of the reference value or null if no such mapping exists
        See Also:
        mappedUUIDs(String,String)
      • processedReference

        public void processedReference​(PropertyState refPropertyState)
        Store the given reference property for later resolution.
        Parameters:
        refPropertyState - reference property state