Process a given {@link Element} attributes

@param element The element to process
@return True if this {@link Element} created a new Context in the stack, false otherwise
165383
private boolean processElementAttributes(Element element) {
    Attributes attributes = element.getAttributes();
    if (attributes == null) {
      return false;
    }

    boolean shouldPopContext = false;
    registerMandatoryAttributes(attributes);

    Attribute vForAttribute = attributes.get("v-for");
    Attribute slotScopeAttribute = attributes.get("slot-scope");
    if (vForAttribute != null || slotScopeAttribute != null) {
      // Add a context layer
      shouldPopContext = true;
      context.addContextLayer(vForAttribute != null);
    }

    if (vForAttribute != null) {
      String processedVForValue = processVForValue(vForAttribute.getValue());
      outputDocument.replace(vForAttribute.getValueSegment(), processedVForValue);
    }

    if (slotScopeAttribute != null) {
      String processedScopedSlotValue = processSlotScopeValue(slotScopeAttribute.getValue());
      outputDocument.replace(slotScopeAttribute.getValueSegment(), processedScopedSlotValue);
    }

    Optional<LocalComponent> localComponent = getLocalComponentForElement(element);

    Attribute refAttribute = attributes.get("ref");
    if (refAttribute != null) {
      result.addRef(
          refAttribute.getValue(),
          localComponent.map(LocalComponent::getComponentType)
              .orElse(getTypeFromDOMElement(element)),
          context.isInVFor()
      );
    }

    Map<String, Class<?>> elementPropertiesType = getPropertiesForDOMElement(element)
        .orElse(new HashMap<>());

    // Iterate on element attributes
    Set<LocalComponentProp> foundProps = new HashSet<>();
    for (Attribute attribute : element.getAttributes()) {
      String key = attribute.getKey();
      if ("v-for".equals(key) || "slot-scope".equals(key)) {
        continue;
      }

      if ("v-model".equals(key)) {
        processVModel(attribute);
        continue;
      }

      Optional<LocalComponentProp> optionalProp =
          localComponent.flatMap(lc -> lc.getPropForAttribute(attribute.getName()));
      optionalProp.ifPresent(foundProps::add);

      if (!VUE_ATTR_PATTERN.matcher(key).matches()) {
        optionalProp.ifPresent(this::validateStringPropBinding);
        continue;
      }

      context.setCurrentSegment(attribute);

      currentAttribute = attribute;
      currentProp = optionalProp.orElse(null);
      currentExpressionReturnType = getExpressionReturnTypeForAttribute(attribute,
          elementPropertiesType);
      String processedExpression = processExpression(attribute.getValue());

      if (attribute.getValueSegment() != null) {
        outputDocument.replace(attribute.getValueSegment(), processedExpression);
      }
    }

    localComponent.ifPresent(lc -> validateRequiredProps(lc, foundProps));

    return shouldPopContext;
  }
1246673
private void processTag(boolean start) {
    	if (start) {
    		nested++;
    		doc.startElement(tag,attributes);
    	}
    	else {
            nested--;
            doc.endElement(tag);
    	}
    }
1005022
public XMLWriter startElement(String element) {
        append("<" + element);
        if (rootElement && xmlns != null) {
            append(" xmlns=\"" + xmlns + "\"");
            rootElement = false;
        }
        append(">");
        elementStack.push(element);
        return this;
    }
239284
public boolean parse(Context context) throws NestingException {
        boolean flag = true;
        Source source = context.getSource();
        int offset = source.getOffset();

        // Log start parsing
        if (log.isTraceEnabled()) {
            log.trace("[{}] Begin {}", offset, this);
        }

        int i;
        for (i = 0; i < patternSize && flag; i++) {
            ProcPatternElement current = elements.get(i);
            ProcPatternElement next;
            if (i < patternSize - 1) {
                next = elements.get(i + 1);
            } else {
                next = context.getTerminator();
            }
            flag = current.parse(context, next);
        }

        if (!flag) {
            if (log.isTraceEnabled()) {
                log.trace("[{}] Rollback {} on {} element", source.getOffset(), this, i);
            }

            source.setOffset(offset);
        } else {
            if (log.isTraceEnabled()) {
                log.trace("[{}] Complete {}", source.getOffset(), this);
            }
        }

        return flag;
    }
22525
private boolean insert(T element) {
        if (!entries.containsKey(element)) {
            head = createEntry(element, head);
            entries.put(element, head);
            return true;
        }
        return false;
    }
69060
public boolean insert(T element){
    if (size < maxSize){
      put(element);
      return true;
    }
    else if (size > 0 && !lessThan(element, top())){
      heap[1] = element;
      adjustTop();
      return true;
    }
    else
      return false;
  }
892830
public boolean process(ElementListener listener) {
        try {
            Chunk chunk;
            Iterator i = getChunks().iterator();
            boolean localDestination = (reference != null && reference.startsWith("#"));
            boolean notGotoOK = true;
            while (i.hasNext()) {
                chunk = (Chunk) i.next();
                if (name != null && notGotoOK && !chunk.isEmpty()) {
                    chunk.setLocalDestination(name);
                    notGotoOK = false;
                }
                if (localDestination) {
                    chunk.setLocalGoto(reference.substring(1));
                }
                listener.add(chunk);
            }
            return true;
        }
        catch(DocumentException de) {
            return false;
        }
    }
831572
public function processElement(\DOMElement $element, ContextInterface $context)
    {
        // Create a property
        $propertyContext = $this->processProperty($element, $context);

        // Process the element in case it's an anonymous thing with no children
        if (!$element->childNodes->length) {
            $this->processChild($element, $context);
        }

        return $propertyContext;
    }
1232018
public T addElement(T element) {
		// make sure that elements are initialized
		getElements();
		if (!containsElement(this.elements, element)) {
			this.elements.add(element);
			element.addChangeListener(this.elementChangeListener);
			element.notifyState();
			return element;
		}
		throw new RuntimeException(element.toString() + " already exists");
	}
1311716
public boolean process(Context context) throws NestingException {
        Source source = context.getSource();

        int count = 0;
        while (source.hasNext() &&
                (strong || context.hasNextAdjustedForTerminator()) &&
                (max < 0 || count < max)) {
            int offset = source.getOffset();
            boolean parsed = false;

            if ((source.nextMayBeConstant() || hasCrazyCode) && !context.checkBadTag(offset)) {
                boolean suspicious = false;

                for (ProcCode code : cachedCodes) {
                    if (code.suspicious(context)) {
                        suspicious = true;
                        if (code.process(context)) {
                            parsed = true;
                            break;
                        }
                    }
                }

                if (suspicious && !parsed && !hasCheck) {
                    context.addBadTag(offset);
                }
            }

            if (!parsed) {
                if (strong) {
                    // If scope is strong and has not a code from scope then stop the scope processing
                    break;
                } else if (ignoreText) {
                    source.incOffset();
                } else {
                    try {
                        context.getTarget().append(source.next());
                    } catch (IOException e) {
                        // Nothing! Because StringBuilder doesn't catch IOException
                    }
                }
            } else {
                count++;
            }
        }

        return min < 0 || count >= min;
    }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }
494542
public boolean add(Object element) {

//        reporter.updateCounter++;
        if (elementCount >= elementData.length) {
            increaseCapacity();
        }

        elementData[elementCount] = element;

        elementCount++;

        return true;
    }
214220
@Override
  public boolean remove(int element)
  {
    if (element < 0) {
      throw new IndexOutOfBoundsException("element < 0: " + element);
    }
    int index = findElementOrEmpty(element);
    if (index < 0) {
      return false;
    }

    cells[index] = REMOVED;
    modCount++;
    size--;
    return true;
  }
507375
@Override
   public boolean remove(Object element)
   {
      for (int index = size - 1; index >= 0; index--) {
         if (element == elementData[index]) {
            final int numMoved = size - index - 1;
            if (numMoved > 0) {
               System.arraycopy(elementData, index + 1, elementData, index, numMoved);
            }
            elementData[--size] = null;
            return true;
         }
      }

      return false;
   }
1149355
public static void add(Element element) {
        AssertUtils.assertNotNull(element);

        ProcessedInput processedInput = null;
        Overrider overrider = new Overrider(defaultOverride);

        overrider.override(XmlParameters.operationType, element.getTagName());

        if (element.hasAttribute(XmlParameters.outputHandler) == true) {
            overrider.override(XmlParameters.outputHandler, element.getAttribute(XmlParameters.outputHandler));
        }

        if (element.hasAttribute(XmlParameters.controlParamCount) == true) {
            overrider.override(XmlParameters.controlParamCount, Boolean.valueOf(element.getAttribute(XmlParameters.controlParamCount)));
        }

        if (element.hasAttribute(XmlParameters.generateKeys) == true) {
            overrider.override(XmlParameters.generateKeys, element.getAttribute(XmlParameters.generateKeys));
        }

        if (element.hasAttribute(XmlParameters.generateKeysColumns) == true) {
            overrider.override(XmlParameters.generateKeysColumns, element.getAttribute(XmlParameters.generateKeysColumns).split(","));
        }

        String name = element.getAttribute("id");
        String encodedQuery = element.getTextContent();

        xmlQueryString.put(name, encodedQuery);
        xmlOverrideMap.put(name, overrider);
    }
1214378
private void processNode(final Node node) {
        processNode(node.getPath(), node);

        Set<Node> children = node.getChildren();
        for (Node child : children) {
            processNode(child);
        }
    }
918005
public void buildAll(MessageMLParser context, org.w3c.dom.Element element) throws InvalidInputException,
      ProcessingException {
    NamedNodeMap attr = element.getAttributes();

    for (int i = 0; i < attr.getLength(); i++) {
      buildAttribute(attr.item(i));
    }

    NodeList children = element.getChildNodes();

    for (int i = 0; i < children.getLength(); i++) {
      buildNode(context, children.item(i));
    }
  }