Method updateModel.

@param value
@param element
@param counter
@param xmlTag
496364
protected void updateModel(Model value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      updateParent(value.getParent(), "parent", innerCount, root);
      findAndReplaceSimpleElement(innerCount, root, "modelVersion", value.getModelVersion(), null);
      findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null);
      findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null);
      findAndReplaceSimpleElement(innerCount, root, "packaging", value.getPackaging(), "jar");
      findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null);
      findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null);
      findAndReplaceSimpleElement(innerCount, root, "description", value.getDescription(), null);
      findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
      updatePrerequisites(value.getPrerequisites(), "prerequisites", innerCount, root);
      updateIssueManagement(value.getIssueManagement(), "issueManagement", innerCount, root);
      updateCiManagement(value.getCiManagement(), "ciManagement", innerCount, root);
      findAndReplaceSimpleElement(innerCount, root, "inceptionYear", value.getInceptionYear(), null);
      iterateMailingList(innerCount, root, value.getMailingLists(), "mailingLists", "mailingList");
      iterateDeveloper(innerCount, root, value.getDevelopers(), "developers", "developer");
      iterateContributor(innerCount, root, value.getContributors(), "contributors", "contributor");
      iterateLicense(innerCount, root, value.getLicenses(), "licenses", "license");
      updateScm(value.getScm(), "scm", innerCount, root);
      updateOrganization(value.getOrganization(), "organization", innerCount, root);
      updateBuild(value.getBuild(), "build", innerCount, root);
      iterateProfile(innerCount, root, value.getProfiles(), "profiles", "profile");
      findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
      iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository");
      iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository");
      iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
      findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports());
      updateReporting(value.getReporting(), "reporting", innerCount, root);
      updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root);
      updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root);
      findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
   }
816217
@ObjectiveCName("changeWithValue:")
    public boolean change(@Nullable T value) {
        if (this.value != null && value != null && value.equals(this.value)) {
            return false;
        }

        // No need in sync. We are not expected complex sync of value models
        this.value = value;

        notify(value);

        return true;
    }
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());
   }
691074
private void appendValue(Object value) {
        if (value == null) {
            append("null");
        } else if (value instanceof MwsObject) {
            append("{");
            needComma = false;
            ((MwsObject) value).writeFragmentTo(this);
            append("}");
        } else if (value instanceof Boolean || value instanceof Number) {
            append(value.toString());
        } else if (value instanceof String) {
            append("\"");
            escape((String) value);
            append("\"");
        } else if (value instanceof Node) {
            appendValue(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof XMLGregorianCalendar) {
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else if (value instanceof Enum) {
            append(value.toString());
        } else {
            throw new IllegalArgumentException("Unsupported type "+value.getClass().getName());
        }
        needComma = true;
    }
382599
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
      updateActivation(value.getActivation(), "activation", innerCount, root);
      updateBuildBase(value.getBuild(), "build", innerCount, root);
      findAndReplaceSimpleLists(innerCount, root, value.getModules(), "modules", "module");
      iterateRepository(innerCount, root, value.getRepositories(), "repositories", "repository");
      iterateRepository(innerCount, root, value.getPluginRepositories(), "pluginRepositories", "pluginRepository");
      iterateDependency(innerCount, root, value.getDependencies(), "dependencies", "dependency");
      findAndReplaceXpp3DOM(innerCount, root, "reports", (Xpp3Dom) value.getReports());
      updateReporting(value.getReporting(), "reporting", innerCount, root);
      updateDependencyManagement(value.getDependencyManagement(), "dependencyManagement", innerCount, root);
      updateDistributionManagement(value.getDistributionManagement(), "distributionManagement", innerCount, root);
      findAndReplaceProperties(innerCount, root, "properties", value.getProperties());
   }
20588
static void setModelValue(final ModelNode model, final String value) {
        if (value != null) {
            model.set(value);
        }
    }
541598
@SuppressWarnings("unchecked")
   protected void replaceXpp3DOM(final Element parent, final Xpp3Dom parentDom, final Counter counter)
   {
      if (parentDom.getChildCount() > 0)
      {
         Xpp3Dom[] childs = parentDom.getChildren();
         Collection<Xpp3Dom> domChilds = new ArrayList<>();
         for (int i = 0; i < childs.length; i++)
         {
            domChilds.add(childs[i]);
         }

         ListIterator<Element> it = parent.getChildren().listIterator();
         while (it.hasNext())
         {
            Element elem = it.next();
            Iterator<Xpp3Dom> it2 = domChilds.iterator();
            Xpp3Dom corrDom = null;
            while (it2.hasNext())
            {
               Xpp3Dom dm = it2.next();
               if (dm.getName().equals(elem.getName()))
               {
                  corrDom = dm;
                  break;
               }
            }
            if (corrDom != null)
            {
               domChilds.remove(corrDom);
               replaceXpp3DOM(elem, corrDom, new Counter(counter.getDepth() + 1));
               counter.increaseCount();
            }
            else
            {
               it.remove();
            }
         }

         Iterator<Xpp3Dom> it2 = domChilds.iterator();
         while (it2.hasNext())
         {
            Xpp3Dom dm = it2.next();
            Element elem = factory.element(dm.getName(), parent.getNamespace());
            for (String attName : dm.getAttributeNames())
            {
               elem.setAttribute(attName, dm.getAttribute(attName));
            }
            insertAtPreferredLocation(parent, elem, counter);
            counter.increaseCount();
            replaceXpp3DOM(elem, dm, new Counter(counter.getDepth() + 1));
         }
      }
      else if (parentDom.getValue() != null)
      {
         parent.setText(parentDom.getValue());
      }
   }
1344461
protected void updateExclusion(Exclusion value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null);
      findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null);
   }
326282
public void addAction(M element, boolean value)
    {
        actions.put(element, Boolean.valueOf(value));
    }
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");
      }
   }
348144
@java.lang.SuppressWarnings({ "ConstantConditions" })
    public void setString(int tagType, @NotNull String value)
    {
        if (value == null)
            throw new NullPointerException("cannot set a null String");
        setObject(tagType, value);
    }
632519
public void addParameter(final String tag, final Object value) {
		if (Util.empty(tag)) {
			throw new IllegalArgumentException("A tag must be provided");
		}

		TemplateModel model = getOrCreateComponentModel();
		if (model.parameters == null) {
			model.parameters = new HashMap<>();
		}
		model.parameters.put(tag, value);
	}
195717
public <T> void set(ElementDescriptor<T> property, T value)
	{
		if (mSet == null)
		{
			mSet = new HashMap<ElementDescriptor<?>, Object>(16);
		}
		mSet.put(property, value);

		if (mRemove != null)
		{
			mRemove.remove(property);
		}
	}
956040
public void add(T value) {
        Element<T> element = new Element<T>(bundle, value);
        element.previous = tail;
        if (tail != null) tail.next = element;
        tail = element;
        if (head == null) head = element;
    }
1191458
public final void addElement(Object value)
  {

    if ((m_firstFree + 1) >= m_mapSize)
    {
      m_mapSize += m_blocksize;

      Object newMap[] = new Object[m_mapSize];

      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);

      m_map = newMap;
    }

    m_map[m_firstFree] = value;

    m_firstFree++;
  }
649966
function(value) {
      const oldValue = this[subScriptName];

      // TODO: add custom comparison options function
      if (oldValue === value) {
        return;
      }

      // Clear old child model
      if (oldValue && oldValue instanceof Model && oldValue.parentModel === this) {
        this.removeModelChild(oldValue);
      }

      this[subScriptName] = value;

      // Update new child model
      if (value && value instanceof Model) {
        this.addModelChild(name, value);
      }

      let po = this.propertyOptions[name];

      let onChange = po.onChange;
      let doNotNotify = po.doNotNotify;
      let skipNotify = false;

      if (onChange) {
        skipNotify = onChange(oldValue, value);
      }

      if (this.propertyChange) {
        this.propertyChange(name, oldValue, value);
      }

      if (!this.deserializing && !skipNotify && !doNotNotify) {
        this.notify(name, this, value, this.getChangeDescriptor(name, oldValue, value));
      }
    }
668376
protected void updateResource(Resource value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "targetPath", value.getTargetPath(), null);
      findAndReplaceSimpleElement(innerCount, root, "filtering",
               (value.isFiltering() == false) ? null : String.valueOf(value.isFiltering()), "false");
      findAndReplaceSimpleElement(innerCount, root, "directory", value.getDirectory(), null);
      findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
      findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
   }