Handle the end of a container (div or span) which can contain a non generated content metadata.
@param context the context of the current tag.
@return true if a non generated content tag has been detected or it's in an macro info.
172495
public boolean handleEnd(TagContext context)
    {
        boolean nonGeneratedContent = (boolean) context.getTagStack().popStackParameter(NON_GENERATED_CONTENT_STACK);
        MacroInfo macroInfo = (MacroInfo) context.getTagStack().getStackParameter(MACRO_INFO);

        if (nonGeneratedContent && macroInfo != null) {
            context.getTagStack().getScannerContext().endDocument();

            XWikiGeneratorListener xWikiGeneratorListener =
                (XWikiGeneratorListener) context.getTagStack().popScannerContext().getfListener();

            PrintRenderer renderer;

            if (context.getTagStack().isInsideBlockElement()) {
                WrappingListener wrappingListener = (WrappingListener) xWikiGeneratorListener.getListener();
                renderer = (PrintRenderer) wrappingListener.getWrappedListener();
            } else {
                renderer = (PrintRenderer) xWikiGeneratorListener.getListener();
            }
            String content = renderer.getPrinter().toString();

            if (context.getTagStack().getStackParameter(PARAMETER_CONTENT_NAME) == null) {
                macroInfo.setContent(content);
            } else {
                String parameterName = (String) context.getTagStack().popStackParameter(PARAMETER_CONTENT_NAME);
                WikiParameters parameters = macroInfo.getParameters();

                // WikiParameters are immutable
                macroInfo.setParameters(parameters.setParameter(parameterName, content));
            }
        }

        return nonGeneratedContent || macroInfo != null;
    }
948274
def end_span
      return unless (span = current_spans.pop)

      span.done

      enqueue.call span

      span
    end
1283461
protected final void closeContext(GenerationContext context) {
		boolean runPostElements = false;
		GenerationContext selectedContext = null;
		synchronized (this) {
			final Iterator<GenerationContext> iterator = this.bufferedContexes.iterator();
			while (selectedContext == null && iterator.hasNext()) {
				final GenerationContext candidate = iterator.next();
				if (Objects.equal(candidate.getTypeIdentifier(), context.getTypeIdentifier())) {
					runPostElements = candidate.getParentContext() == null;
					selectedContext = candidate;
				}
			}
		}
		if (selectedContext == null) {
			throw new IllegalStateException("Not same contexts when closing"); //$NON-NLS-1$
		}
		if (runPostElements) {
			for (final Runnable handler : selectedContext.getPostFinalizationElements()) {
				handler.run();
			}
		}
		synchronized (this) {
			final Iterator<GenerationContext> iterator = this.bufferedContexes.iterator();
			while (iterator.hasNext()) {
				final GenerationContext candidate = iterator.next();
				if (selectedContext == candidate) {
					candidate.setParentContext(null);
					iterator.remove();
					return;
				}
			}
		}
	}
1177585
public boolean parse(Context context, ProcPatternElement terminator) {
        if (isNextIn(context)) {
            if(!ghost) {
                context.getSource().incOffset(valueLength);
            }
            return true;
        } else {
            return false;
        }
    }
182410
def _handle_single_tag_end(self):
        """"""
        stack = self._stack
        # We need to find the index of the TagCloseOpen token corresponding to
        # the TagOpenOpen token located at index 0:
        depth = 1
        for index, token in enumerate(stack[2:], 2):
            if isinstance(token, tokens.TagOpenOpen):
                depth += 1
            elif isinstance(token, tokens.TagCloseOpen):
                depth -= 1
                if depth == 0:
                    break
            elif isinstance(token, tokens.TagCloseSelfclose):
                depth -= 1
                if depth == 0:  # pragma: no cover (untestable/exceptional)
                    raise ParserError(
                        "_handle_single_tag_end() got an unexpected "
                        "TagCloseSelfclose")
        else:  # pragma: no cover (untestable/exceptional case)
            raise ParserError("_handle_single_tag_end() missed a TagCloseOpen")
        padding = stack[index].padding
        stack[index] = tokens.TagCloseSelfclose(padding=padding, implicit=True)
        return self._pop()
1289722
public void end() {
		// if (((ArrayList) this.featureCollection).size() == 0) {
		this.endNewElement();
		// }
		contentHandler.endFeatureCollection(this.featureCollection);
		if (writerContentHandler != null)
			geoJSON = writerContentHandler.endFeatureCollection(geoJSON);
	}
538813
@Override
    public void endDocument(MetaData metadata)
    {
        this.builder.addBlock(new XDOM(this.builder.endBlockList(), metadata));
    }
456894
private void popStackToClose(Token.EndTag endTag) {
        String elName = settings.normalizeTag(endTag.tagName);
        Element firstFound = null;

        for (int pos = stack.size() -1; pos >= 0; pos--) {
            Element next = stack.get(pos);
            if (next.nodeName().equals(elName)) {
                firstFound = next;
                break;
            }
        }
        if (firstFound == null)
            return; // not found, skip

        for (int pos = stack.size() -1; pos >= 0; pos--) {
            Element next = stack.get(pos);
            stack.remove(pos);
            if (next == firstFound)
                break;
        }
    }
877433
public boolean parse(Context context, ProcPatternElement terminator) {
        Source source = context.getSource();
        int offset = source.getOffset();

        int end;
        if (terminator != null && !ghost) {
            end = terminator.findIn(source);
            if (end < 0) {
                if (regex == null) {
                    return false;
                } else {
                    end = source.length();
                }
            }
        } else {
            end = source.length();
        }


        CharSequence value = source.sub(end);

        // If define regex, then find this regex in value
        if (regex != null) {
            Matcher matcher = regex.matcher(value);
            if (matcher.lookingAt()) {
                int lend = matcher.end();
                end = offset + lend;
                value = matcher.group();
            } else {
                return false;
            }
        }

        // Old context value
        CharSequence old = (CharSequence) context.getAttribute(getName());

        // Test this variable already defined and equals with this in this code scope
        CharSequence attr = (CharSequence) context.getLocalAttribute(getName());
        if (attr == null || attr.equals(value)) {
            if (attr == null) {
                if (action == Action.rewrite) {
                    setAttribute(context, value);
                } else {
                    /* action == append */
                    if (old != null) {
                        setAttribute(context, new StringBuilder().append(old).append(value));
                    } else {
                        setAttribute(context, value);
                    }
                }
            }
            if (!ghost) {
                source.incOffset(end - offset);
            }
            return true;
        } else {
            return false;
        }
    }
879262
public boolean handleWelcomeRedirect( FileRequestContext context ) throws IOException {
    if( context.file.isFile() && context.file.getName().equals("index.html")) {
      resolveContentType(context);
      String location = context.path.replaceFirst("/index.html\\Z", "");
      if( location.isEmpty() ) location = "/";
      if( context.request.getQueryString() != null ) location = location + "?" + context.request.getQueryString();
      sendPermanentRedirect(context, location);
      return true;
    }
    return false;
  }
1304700
protected boolean isEndTagEvent(XMLEvent event, QName tagName) {
        return event.isEndElement()
                && event.asEndElement().getName().equals(tagName);
    }
991322
public static Span getValue(Context context) {
    @javax.annotation.Nullable
    Span span = CONTEXT_SPAN_KEY.get(Utils.checkNotNull(context, "context"));
    return span == null ? BlankSpan.INSTANCE : span;
  }
245172
static boolean isEndToEnd(String fieldName) {
    return !"Connection".equalsIgnoreCase(fieldName)
        && !"Keep-Alive".equalsIgnoreCase(fieldName)
        && !"Proxy-Authenticate".equalsIgnoreCase(fieldName)
        && !"Proxy-Authorization".equalsIgnoreCase(fieldName)
        && !"TE".equalsIgnoreCase(fieldName)
        && !"Trailers".equalsIgnoreCase(fieldName)
        && !"Transfer-Encoding".equalsIgnoreCase(fieldName)
        && !"Upgrade".equalsIgnoreCase(fieldName);
  }
875842
def handle_endtag(self, tag):
        """"""
        if tag in self.stroke_after_elements:
            if self.text.endswith(self.stroke_text):
                # Only add a stroke if there isn't already a stroke posted
                # In this case, there was no content between the tags, so
                # remove the starting stroke
                self.text = self.text[:-len(self.stroke_text)]
            else:
                # If there's no linebreak before the stroke, add one!
                if not self.text.endswith('\n'):
                    self.text += '\n'
                self.text += self.stroke_text
        if tag == 'a':
            # If it's a link, add a footnote
            self.text += '[{}]'.format(len(self.links))
        elif tag == 'br' and self.text and not self.text.endswith('\n'):
            # If it's a break, check if there's no break at the end of the
            # content. If there's none, add one!
            self.text += '\n'
        # Reset the lasttag, otherwise this parse can geht confused, if the
        # next element is not wrapped in a new tag.
        if tag == self.lasttag:
            self.lasttag = None
950852
@Override
	public void endElement(String uri, String localName, String name) throws SAXException
    {
        super.endElement(uri, localName, name);
        String currentPath = StringTools.join(nameStack, "/");
        onNode(name,currentPath);
        nameStack.pop();
     }
1213876
@Override
    public void endElement(String uri, String name, String qName) {
	setContent(content.toString().trim());
	content = new StringBuffer();
	inside = "";
	/*
	 * if(tag!=null && tag.getName().equalsIgnoreCase("input")) {
	 * print.ln(tag.getName()+"-"+att.getName()+":"+inside+"-"+insideTag+"-"+insideAtt);
	 * 
	 * }
	 */
	if (qName.equals("tag")) endTag();
	else if (qName.equals("attribute")) endAtt();
	else if (qName.equals("script")) endScript();

    }
664265
function endTagInText(p, token) {
    if (token.tagName === $.SCRIPT) {
        p.pendingScript = p.openElements.current;
    }

    p.openElements.pop();
    p.insertionMode = p.originalInsertionMode;
}