Class NotifyingParserPool

java.lang.Object
org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl
org.eclipse.emf.compare.ide.internal.utils.NotifyingParserPool
All Implemented Interfaces:
XMLParserPool
Direct Known Subclasses:
NoNotificationParserPool

public class NotifyingParserPool extends XMLParserPoolImpl
This implementation of an XML parser pool will notify a list of namespace declaration listeners of all namespaces declared in the parsed resource (xsi:schemalocation), then a list of proxy creation listeners of each and every proxy it sees while loading an XML file as an EMF model.
  • Field Details

    • containmentOnly

      protected final boolean containmentOnly
      Only set containment reference values, ignore the rest.
  • Constructor Details

    • NotifyingParserPool

      public NotifyingParserPool(boolean containmentOnly)
      Default constructor.
      Parameters:
      containmentOnly - only set containment reference values. The model will be mostly empty except for its containment tree.
  • Method Details

    • getDefaultHandler

      public XMLDefaultHandler getDefaultHandler(XMLResource resource, XMLLoad xmlLoad, XMLHelper helper, Map<?,?> options)
      Specified by:
      getDefaultHandler in interface XMLParserPool
      Overrides:
      getDefaultHandler in class XMLParserPoolImpl
    • createDefaultHandler

      protected XMLDefaultHandler createDefaultHandler(XMLResource resource, XMLLoad xmlLoad, XMLHelper helper, Map<?,?> options)
      Create the default (unwrapped) XMLDefaultHandler. This is merely a call to super but can be sub-classed.
      Parameters:
      resource - The resource to load.
      xmlLoad - The XML load to pass on tho the handler.
      helper - The XML helper to pass on tho the handler.
      options - The load options for this resource.
      Returns:
      The created XMLDefaultHandler.
      See Also:
    • addProxyListener

      public void addProxyListener(IProxyCreationListener listener)
      Add a proxy creation listener to this parser pool's list.
      Parameters:
      listener - The listener to add to this pool's list.
    • removeProxyListener

      public void removeProxyListener(IProxyCreationListener listener)
      Remove a proxy creation listener from this parser pool's list.
      Parameters:
      listener - The listener to remove from this pool's list.
    • addNamespaceDeclarationListener

      public void addNamespaceDeclarationListener(INamespaceDeclarationListener listener)
      Add a namespace declaration listener to this parser pool's list.
      Parameters:
      listener - The listener to add to this pool's list.
    • removeNamespaceDeclarationListener

      public void removeNamespaceDeclarationListener(INamespaceDeclarationListener listener)
      Remove a namespace declaration listener from this parser pool's list.
      Parameters:
      listener - The listener to remove from this pool's list.