{
    if (element.getName().equals(TAG_PARSER))
    {
      String type = element.getAttribute(ATT_TYPE);
      if (type == null)
      {
        logMissingAttribute(element, ATT_TYPE);
      }
      else if (element.getAttribute(ATT_CLASS) == null)
      {
        logMissingAttribute(element, ATT_CLASS);
      }
      else if (add)
      {
        Object previous = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(type, new ResourceFactoryDescriptor(element, ATT_CLASS));
        if (previous instanceof ResourceFactoryDescriptor)
        {
          ResourceFactoryDescriptor descriptor = (ResourceFactoryDescriptor)previous;
          EcorePlugin.INSTANCE.log
            ("Both '" + descriptor.element.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register an extension parser for '" + type + "'");
        }
        return true;
      }
      else
      {
        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().remove(type);
        return true;
      }
    }
    return false;
  }