@Override
	public void endElement(String uri, String localName, String qName) throws SAXException {
		super.endElement(uri, localName, qName);
		tag = Tags.fromString(qName);
		if (tag == null) {
			return;
		}

		switch (tag) {
		case ADDEDBY:
			id = Integer.parseInt(valueTag);
			try {
				message.setUser(DaoFactory.getFactory().getUserDao().findByID(id));
			} catch (DaoException e) {
				throw new SAXException(e);
			}
			break;
		case ADDDATE:
			message.setDate(getDateFromString(valueTag));
			break;
		case TEXT:
			message.setText(valueTag);
			break;
		case MESSAGE:
			getEntities().put(message.getId(), message);
			message = null;
			break;
		default:
		}
		tag = null;
	}