@Override
    public void endElement(String uri, String localName, String qName)
            throws SAXException {

        currentLevel--;
        currentElement = false;

        String name = null;
        if (localName != null && localName.length() != 0 && !elementsHandled.contains(localName)) {
            name = localName;
        }
        else if (qName != null && qName.length() != 0 && !elementsHandled.contains(qName)) {
            name = qName;
        }

        if(name != null && name.length() != 0)
        {
            elementsHandled.add(name);
            currentObject.close(name, currentValue);

            if(name.equalsIgnoreCase(currentObject.className))
                currentObject = null;
        }

        currentValue = "";
    }