Class DiagnosticCache

  • Direct Known Subclasses:
    EcoreDiagnosticCache

    public class DiagnosticCache
    extends AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
    Cache for diagnostic results.
    Since:
    1.10
    Author:
    Johannes Faltermeier
    • Constructor Detail

      • DiagnosticCache

        public DiagnosticCache​(org.eclipse.emf.common.notify.Notifier input)
        Default constructor.
        Parameters:
        input - the input
    • Method Detail

      • isInitializing

        protected final boolean isInitializing()
        Queries whether the cache is in the process of initializing itself. This is useful to avoid doing redundant work, such as back-tracking up an EMF containment tree to update parents that have already been covered during the initialization.
        Returns:
        whether the cache is in the process of initializations
        Since:
        1.17
      • getDefaultValue

        public org.eclipse.emf.common.util.Diagnostic getDefaultValue()
        Description copied from class: AbstractCachedTree
        Returns the default value for a cached node.
        The root value will be initialized with this value, too
        Specified by:
        getDefaultValue in class AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
        Returns:
        the default value for a cached tree node
      • createdCachedTreeNode

        protected CachedTreeNode<org.eclipse.emf.common.util.Diagnostic> createdCachedTreeNode​(org.eclipse.emf.common.util.Diagnostic value)
        Description copied from class: AbstractCachedTree
        Creates a cached tree node.
        Specified by:
        createdCachedTreeNode in class AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
        Parameters:
        value - the value stored by the cached tree node
        Returns:
        the created node
      • updateParentNode

        protected void updateParentNode​(java.lang.Object parent,
                                        java.lang.Object object,
                                        org.eclipse.emf.common.util.Diagnostic value)
        Description copied from class: AbstractCachedTree
        Updates the passed parent nodes cached value.
        Overrides:
        updateParentNode in class AbstractCachedTree<org.eclipse.emf.common.util.Diagnostic>
        Parameters:
        parent - the parent object to be updated
        object - the object for which the cached value should be changed.
        value - the the cached value for the object
        Since:
        1.17
      • getObjects

        public java.util.Set<java.lang.Object> getObjects()
        Returns:
        the objects with cached values.
      • getOwnValue

        public org.eclipse.emf.common.util.Diagnostic getOwnValue​(java.lang.Object o)
        Parameters:
        o - the object
        Returns:
        the objects diagnostic
      • dispose

        public void dispose()
        Disposes this cache.
      • reinit

        public void reinit​(org.eclipse.emf.common.notify.Notifier notifier)
        Does a reinit of this cache if the given notifier is different than the current one.
        Parameters:
        notifier - the notifier
      • updateCache

        @Deprecated
        protected void updateCache​(org.eclipse.emf.ecore.EObject element,
                                   DiagnosticCache cache)
        Deprecated.
        UPdates the cache and notifies listeners that this was a potential structure change.
        Parameters:
        element - the changed element
        cache - the cache
      • updateCache

        protected void updateCache​(java.util.Set<org.eclipse.emf.ecore.EObject> elements,
                                   DiagnosticCache cache)
        Updates the cache and notifies listeners that this was a potential structure change.
        Parameters:
        elements - the changed elements
        cache - the cache
        Since:
        1.25
      • handleRemove

        protected void handleRemove​(org.eclipse.emf.ecore.EObject object,
                                    DiagnosticCache cache)
        Remove the given object from the cache.
        Parameters:
        object - the EObject to remove
        cache - the DiagnosticCache from which the object should be removed
        Since:
        1.25
      • getDiagnostic

        protected static org.eclipse.emf.common.util.Diagnostic getDiagnostic​(java.lang.Object object)
        Validate given object and return the result of the validation.
        Parameters:
        object - the object to validate
        Returns:
        the validation result
        Since:
        1.25
      • notifyValidationListeners

        protected void notifyValidationListeners​(java.util.Set<org.eclipse.emf.ecore.EObject> updatedObjects,
                                                 boolean potentialStructuralChange)
        Notify the registered validation listeners that a validation occurred.
        Parameters:
        updatedObjects - the objects that changed
        potentialStructuralChange - whether the validation was caused by a structural change
        Since:
        1.25
      • updateCacheWithoutRefresh

        @Deprecated
        protected void updateCacheWithoutRefresh​(org.eclipse.emf.ecore.EObject element,
                                                 DiagnosticCache cache)
        Deprecated.
        Updates the cache and notifes listeners that this change was not a structure change.
        Parameters:
        element - the element
        cache - the cache
      • updateCacheWithoutRefresh

        protected void updateCacheWithoutRefresh​(java.util.Set<org.eclipse.emf.ecore.EObject> elements,
                                                 DiagnosticCache cache)
        Updates the cache and notifes listeners that this change was not a structure change.
        Parameters:
        elements - the elements
        cache - the cache
        Since:
        1.25