Method updatePlugin.

@param value
@param element
@param counter
@param xmlTag
483260
protected void updatePlugin(Plugin value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), "org.apache.maven.plugins");
      findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null);
      findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null);
      findAndReplaceSimpleElement(innerCount, root, "extensions",
               (value.isExtensions() == false) ? null : String.valueOf(value.isExtensions()), "false");
      iteratePluginExecution(innerCount, root, value.getExecutions(), "executions", "execution");
      iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
      findAndReplaceXpp3DOM(innerCount, root, "goals", (Xpp3Dom) value.getGoals());
      findAndReplaceSimpleElement(innerCount, root, "inherited", value.getInherited(), null);
      findAndReplaceXpp3DOM(innerCount, root, "configuration", (Xpp3Dom) value.getConfiguration());
   }
67377
protected void updateCiManagement(CiManagement value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "system", value.getSystem(), null);
         findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
         iterateNotifier(innerCount, root, value.getNotifiers(), "notifiers", "notifier");
      }
   }
660372
protected void updateContributor(Contributor value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null);
      findAndReplaceSimpleElement(innerCount, root, "email", value.getEmail(), null);
      findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      findAndReplaceSimpleElement(innerCount, root, "organization", value.getOrganization(), null);
      findAndReplaceSimpleElement(innerCount, root, "organizationUrl", value.getOrganizationUrl(), null);
      findAndReplaceSimpleLists(innerCount, root, value.getRoles(), "roles", "role");
      findAndReplaceSimpleElement(innerCount, root, "timezone", value.getTimezone(), null);
      findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
   }
875835
public void addAction(M element, byte value)
    {
        actions.put(element, Byte.valueOf(value));
    }
271683
protected void updateActivation(Activation value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "activeByDefault",
                  (value.isActiveByDefault() == false) ? null : String.valueOf(value.isActiveByDefault()), "false");
         findAndReplaceSimpleElement(innerCount, root, "jdk", value.getJdk(), null);
         updateActivationOS(value.getOs(), "os", innerCount, root);
         updateActivationProperty(value.getProperty(), "property", innerCount, root);
         updateActivationFile(value.getFile(), "file", innerCount, root);
      }
   }
91388
protected void updateRepositoryPolicy(RepositoryPolicy value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "enabled",
                  (value.isEnabled() == true) ? null : String.valueOf(value.isEnabled()), "true");
         findAndReplaceSimpleElement(innerCount, root, "updatePolicy", value.getUpdatePolicy(), null);
         findAndReplaceSimpleElement(innerCount, root, "checksumPolicy", value.getChecksumPolicy(), null);
      }
   }
14321
protected void updateIssueManagement(IssueManagement value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "system", value.getSystem(), null);
         findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      }
   }
1286248
private void addElement(String key, String value) {
        this.num_items++;
        List<String> vals = this.values.get(key);
        if (null == vals) {
            vals = new LinkedList<String>();
        }
        if (null == value) {
            vals.add("\"\"");
        } else {
            vals.add(value);
        }
        this.values.put(key, vals);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addElement: " + key + "=" + value + " num: " + this.num_items);
        }
    }
585496
protected void updateActivationFile(ActivationFile value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "missing", value.getMissing(), null);
         findAndReplaceSimpleElement(innerCount, root, "exists", value.getExists(), null);
      }
   }
333879
public void setTagValue(String name, long value) {
        removeTag(name);
        XtraTag tag = new XtraTag(name);
        tag.values.addElement(new XtraValue(value));
        tags.addElement(tag);
    }
1283046
private void appendValue(Object value) {
        if (value instanceof Boolean) {
            closeTag();
            append(value.toString());
        } else if (value instanceof Number) {
            closeTag();
            append(value.toString());
        } else if (value instanceof String) {
            closeTag();
            escape((String) value);
        } else if (value instanceof MwsObject) {
            ((MwsObject) value).writeFragmentTo(this);
        } else if (value instanceof Node) {
            closeTag();
            append(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof Enum) {
            closeTag();
            append(((Enum<?>) value).toString());
        } else if (value instanceof XMLGregorianCalendar) {
            closeTag();
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else {
            throw new IllegalArgumentException();
        }
    }
983567
@Override
    public void onPluginEvent(PluginEvent event) {
        ElementPlugin plugin = event.getPlugin();
        
        switch (event.getAction()) {
            case SUBSCRIBE:
                init();
                plugins.add(plugin);
                plugin.setDisabled(isDisabled());
                break;
            
            case UNSUBSCRIBE:
                plugins.remove(plugin);
                plugin.setDisabled(false);
                break;
        }
    }
588794
protected Element updateElement(Counter counter, Element parent, String name, boolean shouldExist)
   {
      Element element = parent.getChild(name, parent.getNamespace());
      if ((element != null) && shouldExist)
      {
         counter.increaseCount();
      }
      if ((element == null) && shouldExist)
      {
         element = factory.element(name, parent.getNamespace());
         insertAtPreferredLocation(parent, element, counter);
         counter.increaseCount();
      }
      if (!shouldExist && (element != null))
      {
         int index = parent.indexOf(element);
         if (index > 0)
         {
            Content previous = parent.getContent(index - 1);
            if (previous instanceof Text)
            {
               Text txt = (Text) previous;
               if (txt.getTextTrim().length() == 0)
               {
                  parent.removeContent(txt);
               }
            }
         }
         parent.removeContent(element);
      }
      return element;
   }
856397
protected void updatePatternSet(PatternSet value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
         findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
      }
   }
48019
private void addElement(String value) {
        if (null == value) {
            return;
        }
        this.num_items++;
        this.genericValues.add(value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addElement: " + value + " num: " + this.num_items);
        }
    }
666792
protected void updateRepository(Repository value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      updateRepositoryPolicy(value.getReleases(), "releases", innerCount, root);
      updateRepositoryPolicy(value.getSnapshots(), "snapshots", innerCount, root);
      findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
      findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null);
      findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      findAndReplaceSimpleElement(innerCount, root, "layout", value.getLayout(), "default");
   }
683236
synchronized Plugin nextPlugin() {
    	if (!init) {
    		this.reset();
    	}
    	
        Plugin plugin = probeNextPlugin();
        if (plugin == null) {
            return null;
        }
        
        listPending.remove(plugin);
        plugin.setTimeStarted();
        listRunning.add(plugin);

        return plugin;
    }