package beaform.importer;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import beaform.entities.FormulaTag;

public class TagHandler extends DefaultHandler {

	private static final Logger LOG = LoggerFactory.getLogger(ImporterHandler.class);

	private final List<FormulaTag> tags = new ArrayList<>();
	private final SAXHandlerMaster handlerMaster;

	private boolean isInTag;

	public TagHandler(SAXHandlerMaster handlerMaster){
		this.handlerMaster = handlerMaster;
	}

	@Override
	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {

		LOG.debug("Start Element :" + qName);

		switch (qName) {
			case "tag":
				this.isInTag = true;
				break;
			default:
				break;
		}
	}

	@Override
	public void endElement(String uri, String localName, String qName) throws SAXException {
		switch (qName) {
			case "tag":
				this.isInTag = false;
				break;
			case "tags":
				this.handlerMaster.gainControl();
				break;
			default:
				break;
		}
	}

	@Override
	public void characters(char[] ch, int start, int length) throws SAXException {
		if (this.isInTag) {
			final String tagName = new String(ch, start, length);
			final FormulaTag newTag = new FormulaTag(tagName);
			this.tags.add(newTag);
		}
	}

	public List<FormulaTag> getTags() {
		return this.tags;
	}

}

@@ -809,41 +809,35 @@
 %0A%0A%09%09
-switch 
+if (%22tag%22.equals
 (qName)
+)
  %7B%0A
-%09%09%09case %22tag%22:%0A%09
 %09%09%09t
@@ -860,42 +860,8 @@
 ue;%0A
-%09%09%09%09break;%0A%09%09%09default:%0A%09%09%09%09break;%0A
 %09%09%7D%0A

Use an if-statement instead of a switch that only has a single case