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

        Logger.getLogger(UserHandler.class.getName()).log(Level.FINER,
                String.format("Setting %s in new user to %s.", qName, content.toString()));
        
        if (qName.equalsIgnoreCase(USERNAME)) {
            user.setUsername(content.toString());
        }
        if (qName.equalsIgnoreCase(PASSWORD)) {
            user.setPassword(content.toString());
        }
        if (qName.equalsIgnoreCase(FIRSTNAME)) {
            user.setFirstName(content.toString());
        }
        if (qName.equalsIgnoreCase(LASTNAME)) {
            user.setLastName(content.toString());
        }
        if (qName.equalsIgnoreCase(EMAIL)) {
            user.setEmail(content.toString());
        }
        if (qName.equalsIgnoreCase(INDEXEDRECORDS)) {
            user.setIndexedRecords(Integer.parseInt(content.toString()));
        }
        if (qName.equalsIgnoreCase(IndexerHandler.USER)) {
            try {
                database.startTransaction();
                database.insert(user);
                database.endTransaction(true);
            }
            catch (Database.DatabaseException | Database.InsertFailedException ex) {
                try {
                    database.endTransaction(false);
                } catch (Database.DatabaseException ex1) {
                    Logger.getLogger(FieldHandler.class.getName()).log(Level.SEVERE, null, ex1);
                }
                finally {
                    throw new SAXException(ex.getMessage());
                }
            }
            reader.setContentHandler(parent);
        }
    }