Handles the end element event.

@param uri the element's URI
@param localName the local name
@param qName the qualified name
@throws SAXException thrown if there is an exception processing the
element
765163
@Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (HINT.equals(qName) && rule != null) {
            hintRules.add(rule);
            rule = null;
        }
    }
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();
     }
679386
public void endElement (String qName)
    throws SAXException
    {
                // If we're not doing Namespace
                // processing, dispatch this quickly.
    if (!namespaces) {
        if (contentHandler != null) {
        contentHandler.endElement("", "", qName.intern());
        }
        return;
    }

                // Split the name.
    String names[] = processName(qName, false, false);
    if (contentHandler != null) {
        contentHandler.endElement(names[0], names[1], names[2]);
        Enumeration prefixes = nsSupport.getDeclaredPrefixes();
        while (prefixes.hasMoreElements()) {
        String prefix = (String)prefixes.nextElement();
        contentHandler.endPrefixMapping(prefix);
        }
    }
    nsSupport.popContext();
    }
149715
void writeEndElement(final Writer output, final String name) throws SAXException {
        try {
            output.write(LESS_THAN);
            output.write(SLASH);
            output.write(name);
            output.write(GREATER_THAN);
        } catch (IOException e) {
            throw new SAXException(e);
        }
    }
1035208
@Override
    public void endElement( String uri, String localName, String qName )
        throws SAXException
    {
        flushCharacters();
        if ( stack.isEmpty() )
        {
            throw new IllegalStateException( "Stack must not be empty when closing the element " + qName
                + " around line " + locator.getLineNumber() + " and column " + locator.getColumnNumber() );
        }
        IndentCheckSaxHandler.ElementEntry startEntry = stack.pop();
        int indentDiff = lastIndent.size - startEntry.expectedIndent.size;
        int expectedIndent = startEntry.expectedIndent.size;
        if ( lastIndent.lineNumber != startEntry.foundIndent.lineNumber && indentDiff != 0 )
        {
            /*
             * diff should be zero unless we are on the same line as start element
             */
            int opValue = expectedIndent - lastIndent.size;
            String op = opValue > 0 ? "Insert" : "Delete";
            String units = opValue == 1 ? "space" : "spaces";
            String message = op + " " + Math.abs( opValue ) + " " + units + ". Expected " + expectedIndent + " found "
                + lastIndent.size + " spaces before end element </" + qName + ">";
            XmlFormatViolation violation =
                new XmlFormatViolation( file, locator.getLineNumber(), locator.getColumnNumber(), message );
            violationHandler.handle( violation );
        }
    }
1136332
@Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (null != qName) {
            switch (qName) {
                case COMPANY_NAME:
                    data.setCompanyName(currentText.toString());
                    break;
                case PRODUCT_NAME:
                    data.setProductName(currentText.toString());
                    break;
                case PRODUCT_VERSION:
                    data.setProductVersion(currentText.toString());
                    break;
                case COMMENTS:
                    data.setComments(currentText.toString());
                    break;
                case FILE_DESCRIPTION:
                    data.setFileDescription(currentText.toString());
                    break;
                case FILE_NAME:
                    data.setFileName(currentText.toString());
                    break;
                case FILE_VERSION:
                    data.setFileVersion(currentText.toString());
                    break;
                case INTERNAL_NAME:
                    data.setInternalName(currentText.toString());
                    break;
                case ORIGINAL_FILE_NAME:
                    data.setOriginalFilename(currentText.toString());
                    break;
                case FULLNAME:
                    data.setFullName(currentText.toString());
                    break;
                case NAMESPACE:
                    data.addNamespace(currentText.toString());
                    break;
                case ERROR:
                    data.setError(currentText.toString());
                    break;
                case WARNING:
                    data.setWarning(currentText.toString());
                    break;
                default:
                    break;
            }
        }
    }
880848
public void endElement(String uri, String lname, String name) {
        // System.err.println("End: " + name);
    	name = name.toLowerCase();
        if (ElementTags.PARAGRAPH.equals(name)) {
            try {
                document.add((Element) stack.pop());
                return;
            } catch (DocumentException e) {
                throw new ExceptionConverter(e);
            }
        }
        if (HtmlTagMap.isHead(name)) {
            // we do nothing
            return;
        }
        if (HtmlTagMap.isTitle(name)) {
            if (currentChunk != null) {
                bodyAttributes.put(ElementTags.TITLE, currentChunk.getContent());
            }
            return;
        }
        if (HtmlTagMap.isMeta(name)) {
            // we do nothing
            return;
        }
        if (HtmlTagMap.isLink(name)) {
            // we do nothing
            return;
        }
        if (HtmlTagMap.isBody(name)) {
            // we do nothing
            return;
        }
        if (myTags.containsKey(name)) {
            XmlPeer peer = (XmlPeer) myTags.get(name);
            if (ElementTags.TABLE.equals(peer.getTag())) {
                tableBorder = false;
            }
            super.handleEndingTags(peer.getTag());
            return;
        }
        // super.handleEndingTags is replaced with handleEndingTags
        // suggestion by Ken Auer
        handleEndingTags(name);
    }
584116
public XMLDocument endElements(String uri, String name) throws SAXException{
        QName qname = findEndElement();
        while(true){
            endElement(qname);
            if(qname.getNamespaceURI().equals(uri) && qname.getLocalPart().equals(name))
                break;
        }
        return this;
    }
121046
@Override
    public void startElement( String uri, String localName, String qName, Attributes attributes )
        throws SAXException
    {
        flushCharacters();
        IndentCheckSaxHandler.ElementEntry currentEntry = new ElementEntry( qName, lastIndent );
        if ( !stack.isEmpty() )
        {
            IndentCheckSaxHandler.ElementEntry parentEntry = stack.peek();
            /*
             * note that we use parentEntry.expectedIndent rather than parentEntry.foundIndent this is to make the
             * messages more useful
             */
            int indentDiff = currentEntry.foundIndent.size - parentEntry.expectedIndent.size;
            int expectedIndent = parentEntry.expectedIndent.size + indentSize;
            if ( indentDiff == 0 && currentEntry.foundIndent.lineNumber == parentEntry.foundIndent.lineNumber )
            {
                /*
                 * Zero foundIndent acceptable only if current is on the same line as parent This is OK, therefore do
                 * nothing
                 */
            }
            else if ( indentDiff != indentSize )
            {
                /* generally unexpected foundIndent */
                int opValue = expectedIndent - currentEntry.foundIndent.size;
                String op = opValue > 0 ? "Insert" : "Delete";
                String message = op + " " + Math.abs( opValue ) + " spaces. Expected " + expectedIndent + " found "
                    + currentEntry.foundIndent.size + " spaces before start element <" + currentEntry.elementName + ">";

                XmlFormatViolation violation =
                    new XmlFormatViolation( file, locator.getLineNumber(), locator.getColumnNumber(), message );
                violationHandler.handle( violation );

                /* reset the expected indent in the entry we'll push */
                currentEntry =
                    new ElementEntry( qName, lastIndent, new Indent( lastIndent.lineNumber, expectedIndent ) );
            }
        }
        stack.push( currentEntry );
    }
254236
protected void endNode(int node) throws org.xml.sax.SAXException
  {

    switch (m_dtm.getNodeType(node))
    {
    case DTM.DOCUMENT_NODE :
      this.m_contentHandler.endDocument();
      break;
    case DTM.ELEMENT_NODE :
      String ns = m_dtm.getNamespaceURI(node);
      if(null == ns)
        ns = "";
      this.m_contentHandler.endElement(ns,
                                         m_dtm.getLocalName(node),
                                         m_dtm.getNodeName(node));

      for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
           nsn = m_dtm.getNextNamespaceNode(node, nsn, true))
      {
        // String prefix = m_dtm.getPrefix(nsn);
        String prefix = m_dtm.getNodeNameX(nsn);

        this.m_contentHandler.endPrefixMapping(prefix);
      }
      break;
    case DTM.CDATA_SECTION_NODE :
      break;
    case DTM.ENTITY_REFERENCE_NODE :
    {
      if (m_contentHandler instanceof LexicalHandler)
      {
        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);

        lh.endEntity(m_dtm.getNodeName(node));
      }
    }
    break;
    default :
    }
  }
593165
public void endElement(String uri, String name, String qName)
    {
        boolean isDebug = logger.isDebugEnabled();
        try
        {
            switch (getLiteralId(qName))
            {
                case MAPPING_REPOSITORY:
                    {
                        if (isDebug) logger.debug(" < " + tags.getTagById(MAPPING_REPOSITORY));
                        this.m_CurrentAttrContainer = null;
                        m_CurrentCLD = null;
                        break;
                    }
                case CLASS_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("  < " + tags.getTagById(CLASS_DESCRIPTOR));
                        m_CurrentCLD = null;
                        this.m_CurrentAttrContainer = null;
                        break;
                    }
                case OBJECT_CACHE:
                    {
                        if(m_CurrentAttrContainer != null)
                        {
                            if (isDebug) logger.debug("     < " + tags.getTagById(OBJECT_CACHE));
                        }
                        this.m_CurrentAttrContainer = m_CurrentCLD;
                        break;
                    }
                case CLASS_EXTENT:
                    {
                        break;
                    }
                case FIELD_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(FIELD_DESCRIPTOR));
                        m_CurrentFLD = null;
                        m_CurrentAttrContainer = m_CurrentCLD;
                        break;
                    }
                case REFERENCE_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(REFERENCE_DESCRIPTOR));
                        m_CurrentORD = null;
                        m_CurrentAttrContainer = m_CurrentCLD;
                        break;
                    }
                case FOREIGN_KEY:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(FOREIGN_KEY));
                        break;
                    }
                case COLLECTION_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(COLLECTION_DESCRIPTOR));
                        m_CurrentCOD = null;
                        m_CurrentAttrContainer = m_CurrentCLD;
                        break;
                    }
                case INVERSE_FK:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(INVERSE_FK));
                        break;
                    }
                case ORDERBY :
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(ORDERBY));
                        break;
                    }
                case FK_POINTING_TO_THIS_CLASS:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(FK_POINTING_TO_THIS_CLASS));
                        break;
                    }
                case FK_POINTING_TO_ITEMS_CLASS:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(FK_POINTING_TO_ITEMS_CLASS));
                        break;
                    }
                case ATTRIBUTE:
                    {
                        if(m_CurrentAttrContainer != null)
                        {
                            if (isDebug) logger.debug("      < " + tags.getTagById(ATTRIBUTE));
                        }
                        break;
                    }
                case DOCUMENTATION:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(DOCUMENTATION));
                        break;
                    }
//                case SEQUENCE_MANAGER:
//                    {
//                        // currently not used on class-descriptor level
//                        // if (isDebug) logger.debug("    < " + tags.getTagById(SEQUENCE_MANAGER));
//                        this.m_CurrentAttrContainer = null;
//                        break;
//                    }
//                case CONNECTION_POOL:
//                    {
//                        // not used on class-descriptor level
//                        // if (isDebug) logger.debug("    < " + tags.getTagById(CONNECTION_POOL));
//                        this.m_CurrentAttrContainer = null;
//                        break;
//                    }
//                case JDBC_CONNECTION_DESCRIPTOR:
//                    {
//                        // not used on class-descriptor level
//                        // if (isDebug) logger.debug("    < " + tags.getTagById(JDBC_CONNECTION_DESCRIPTOR));
//                        this.m_CurrentAttrContainer = null;
//                        break;
//                    }
                case QUERY_CUSTOMIZER:
                    {
                        m_CurrentAttrContainer = m_CurrentCOD;
                        break;
                    }
                case INDEX_DESCRIPTOR:
                    {
                        m_CurrentCLD.getIndexes().add(m_CurrentIndexDescriptor);
                        m_CurrentIndexDescriptor = null;
                        break;
                    }
                case INDEX_COLUMN:
                    {
                        // ignore; all processing done in startElement
                        break;
                    }
                case INSERT_PROCEDURE:
                {
                    if (isDebug) logger.debug("    < " + tags.getTagById(INSERT_PROCEDURE));
                    m_CurrentCLD.setInsertProcedure((InsertProcedureDescriptor)m_CurrentProcedure);
                    m_CurrentProcedure = null;
                    break;
                }
                case UPDATE_PROCEDURE:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(UPDATE_PROCEDURE));
                        m_CurrentCLD.setUpdateProcedure((UpdateProcedureDescriptor)m_CurrentProcedure);
                        m_CurrentProcedure = null;
                        break;
                    }
                case DELETE_PROCEDURE:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(DELETE_PROCEDURE));
                        m_CurrentCLD.setDeleteProcedure((DeleteProcedureDescriptor)m_CurrentProcedure);
                        m_CurrentProcedure = null;
                        break;
                    }
                case CONSTANT_ARGUMENT:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(CONSTANT_ARGUMENT));
                        break;
                    }
                case RUNTIME_ARGUMENT:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(RUNTIME_ARGUMENT));
                        break;
                    }

                    // handle failure:
                default :
                    {
                        logger.debug("Ignoring unused Element " + qName);
                    }
            }
        }
        catch (Exception ex)
        {
            if(ex instanceof MetadataException) throw (MetadataException) ex;
            else throw new MetadataException("Exception when reading metadata information,"+
                    " please check your repository.xml file", ex);
        }
    }
311007
@Override
    public void endElement(String uri, String name, String qName) {
	setContent(content.toString().trim());
	content = new StringBuilder();
	inside = "";
	if (qName.equals("function")) endFunction();
	else if (qName.equals("argument")) endArg();
	else if (qName.equals("return")) endReturn();
	else if (qName.equals("bundle")) endBundle();

    }
426404
public void namespaceAfterStartElement(
        final String prefix,
        final String uri)
        throws SAXException
    {
        startPrefixMapping(prefix,uri,false);
    }
1231599
@Override
    public void startElement(final String uri, final String localName, final String name,
            final Attributes atts) throws SAXException {
        if (ignoreDepth > 0) {
            ignoreDepth++;
            return;
        }

        if (PR_D_CODEREF.matches(atts)) {
            ignoreDepth++;
            try {
                final URI hrefValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
                if (hrefValue != null) {
                    final File codeFile = getFile(hrefValue);
                    if (codeFile != null && codeFile.exists()) {
                        logger.debug("Resolve coderef " + codeFile);
                        final Charset charset = getCharset(atts.getValue(ATTRIBUTE_NAME_FORMAT));
                        final Range range = getRange(hrefValue);
                        try (BufferedReader codeReader = new BufferedReader(
                                new InputStreamReader(new FileInputStream(codeFile), charset))) {
                            range.copyLines(codeReader);
                        } catch (final Exception e) {
                            logger.error("Failed to process code reference " + codeFile, e);
                        }
                    } else {
                        logger.warn(MessageUtils.getMessage("DOTJ051E", hrefValue.toString()).setLocation(atts).toString());
                    }
                } else {
                    //logger.logDebug("Code reference target not defined");
                }
            } catch (final Exception e) {
                logger.error(e.getMessage(), e) ;
            }
        } else {
            super.startElement(uri, localName, name, atts);
        }
    }
92413
@Override
    public void endElement(String uri, String localName, String name) throws SAXException {
        if ("table".equals(name)) {
            for (final Column column : this.currentColumns.values()) {
                this.currentTable.addColumn(column);
            }

            if (this.primaryKey != null) {
                this.currentTable.setPrimaryKey(this.primaryKey);
            }

            this.tables.put(this.currentTable.getName(), this.currentTable);
            this.tableColumnTypes.put(this.currentTable.getName(), this.currentColumnTypes);
            this.primaryKey = null;
            this.currentColumns = null;
            this.currentColumnTypes = null;
            this.currentTable = null;
        } else if ("column".equals(name)) {
            this.currentColumns.put(this.currentColumn.getName(), this.currentColumn);
            this.currentColumn = null;
        } else if ("name".equals(name)) {
            final String itemName = this.chars.toString().trim();

            if (this.currentIndex != null) {
                this.currentIndex.setName(itemName);
            } else if (this.currentUnique != null) {
                this.currentUnique.setName(itemName);
            } else if (this.currentTable == null) {
                this.currentTable = new Table(itemName);
            } else if (this.currentColumn == null) {
                this.currentColumn = new Column(itemName);
            }
        } else if ("type".equals(name)) {
            final String sqlTypeName = this.chars.toString().trim();

            final int sqlType = this.getSqlType(sqlTypeName);
            this.currentColumnTypes.put(this.currentColumn.getName(), sqlType);

            final String hibType = this.getHibernateType(sqlType);

            final SimpleValue value = new SimpleValue(this.mappings, this.currentTable);
            value.setTypeName(hibType);

            this.currentColumn.setValue(value);
        } else if ("param".equals(name)) {
            final String param = this.chars.toString().trim();

            final Integer length = Integer.valueOf(param);
            this.currentColumn.setLength(length);
        } else if ("primary-key".equals(name)) {
            final String columnName = this.chars.toString().trim();

            if (this.primaryKey == null) {
                this.primaryKey = new PrimaryKey();
            }

            final Column column = this.currentColumns.get(columnName);
            this.primaryKey.addColumn(column);
        } else if ("not-null".equals(name)) {
            final String columnName = this.chars.toString().trim();
            final Column column = this.currentColumns.get(columnName);
            column.setNullable(false);
        } else if ("column-ref".equals(name)) {
            final String columnName = this.chars.toString().trim();
            final Column column = this.currentColumns.get(columnName);

            if (this.currentIndex != null) {
                this.currentIndex.addColumn(column);
            } else if (this.currentUnique != null) {
                this.currentUnique.addColumn(column);
            }
        } else if ("index".equals(name)) {
            this.currentTable.addIndex(this.currentIndex);
            this.currentIndex = null;
        } else if ("unique".equals(name)) {
            this.currentTable.addUniqueKey(this.currentUnique);
            this.currentUnique = null;
        } else if ("key".equals(name)) {
            this.logger.warn(
                    "the 'key' element is ignored, use the table level 'primary-key' element instead");
        }

        this.chars = null;
    }
791667
@Override
    public void startElement(String namespace, String localName, String qName, Attributes attributes) throws SAXException {

        if (skipElementUntil != null) {
            elementStack.push(skippableElement);
            return;
        }

        boolean mixedContent = detectMixedContent();

        if (builder.xsiTypeSupport && attributes.getValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) {
            String type = attributes.getValue("http://www.w3.org/2001/XMLSchema-instance", "type");

            if (type.contains(":")) {
                String[] split = type.split(":");
                namespace = prefixUriMap.get(split[0]);
                localName = split[1];
            } else {
                localName = type;
            }
        }

        Element<ResourceType, Datatype> element = new Element<>(this, builder);
        element.index = index++;

        namespace = calculateNamespace(namespace);

        element.setType(namespace + localName);

        if (builder.skipElementMap != null && builder.skipElementMap.containsKey(element.getType())) {
            skipElementUntil = element;
            elementStack.push(element);
            return;
        }


        Element<ResourceType, Datatype> parent = null;

        if (!elementStack.isEmpty()) {
            parent = elementStack.peek();
            if (builder.addIndex) {
                element.elementIndex = parent.indexMap.plusPlus(element.getType());
            }
            parent.hasChild.add(element);
            if(builder.useHashmapForChildren){
                parent.hasChildMap.put(element.getType(), element);
            }
            if (mixedContent) {
                parent.addMixedContent(element);
            }

        }

        element.parent = parent;

        renameElement(namespace, localName, element);

        if (builder.forcedMixedContentMap != null &&
            builder.forcedMixedContentMap.containsKey(element.getType())) {

            element.containsMixedContent = true;
        }


        if (builder.compositeIdMap != null) {

            CompositeId compositeId = builder.compositeIdMap.get(element.getType());
            if (compositeId == null) {
                calculateNodeId(element);
            } else {
                element.compositeId = compositeId.simpleClone();
                if(element.compositeId.elementIndex){
                    element.compositeId.reolveElementIndex(XmlToRdfVocabulary.index, element.index);
                    element.compositeId.reolveElementIndex(XmlToRdfVocabulary.elementIndex, element.elementIndex);
                }

            }

        } else {
            calculateNodeId(element);
        }

        handleAttributes(namespace, attributes, element);

        if (builder.useElementAsPredicateMap != null && builder.useElementAsPredicateMap.containsKey(element.getType())) {
            element.useElementAsPredicate = true;
        }

        builder.doComplexTransformElementAtStartOfElement(element);


        elementStack.push(element);

    }
247911
protected void fireEndElem(String name)
        throws org.xml.sax.SAXException
    {
        if (m_tracer != null)
        {
            flushMyWriter();
            m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null);
        }     	        	    	
    }