Class ReferenceChangeTracker

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

      • ReferenceChangeTracker

        public ReferenceChangeTracker()
    • Method Detail

      • clear

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

        public void mappedId​(NodeId oldId,
                             NodeId newId)
        Store the given id mapping for later lookup using getMappedId(NodeId).
        oldId - old node id
        newId - new node id
      • processedReference

        public void processedReference​(Object refProp)
        Store the given reference property for later retrieval using getProcessedReferences().
        refProp - reference property
      • getMappedId

        public NodeId getMappedId​(NodeId oldId)
        Returns the new node id to which oldId has been mapped or null if no such mapping exists.
        oldId - old node id
        mapped new id or null if no such mapping exists
        See Also:
        mappedId(NodeId, NodeId)
      • getProcessedReferences

        public Iterator<Object> getProcessedReferences()
        Returns an iterator over all processed reference properties.
        an iterator over all processed reference properties
        See Also:
      • removeReferences

        public boolean removeReferences​(List<Object> processedReferences)
        Remove the given references that have already been processed from the references list.
        processedReferences -
        true if the internal list of references changed.