@Override
    public void endElement(final String uri, final String localName, final String qName) throws SAXException {
        if (DOCUMENT.equals(localName)) {
            if (!currentFieldValues.isEmpty()) {
                processFields(currentFieldValues);
            }
            currentFieldValues.clear();
            currentFieldBuilder = IndexFieldImpl.builder();
            currentVal = null;

        } else if (FIELD.equals(localName)) {
            if (currentFieldBuilder != null && currentVal != null) {
                final IndexFieldImpl indexField = currentFieldBuilder.build();
                final FieldValue fieldValue = new FieldValue(indexField, currentVal);
                currentFieldValues.add(fieldValue);
            }

            currentFieldBuilder = IndexFieldImpl.builder();
            currentVal = null;

        } else if (NAME.equals(localName)) {
            currentFieldBuilder.fldName(content.toString());
        } else if (TYPE.equals(localName)) {
            final FieldType type = FieldType.fromDisplayValue(content.toString());
            currentFieldBuilder.fldType(type);
        } else if (ANALYSER.equals(localName)) {
            final AnalyzerType analyzerType = AnalyzerType.fromDisplayValue(content.toString());
            currentFieldBuilder.analyzerType(analyzerType);
        } else if (INDEXED.equals(localName)) {
            currentFieldBuilder.indexed(Boolean.parseBoolean(content.toString()));
        } else if (STORED.equals(localName)) {
            currentFieldBuilder.stored(Boolean.parseBoolean(content.toString()));
        } else if (TERM_POSITIONS.equals(localName)) {
            currentFieldBuilder.termPositions(Boolean.parseBoolean(content.toString()));
        } else if (CASE_SENSITIVE.equals(localName)) {
            currentFieldBuilder.caseSensitive(Boolean.parseBoolean(content.toString()));
        } else if (VALUE.equals(localName)) {
            final IndexFieldImpl indexField = currentFieldBuilder.build();
            currentVal = convertValue(indexField, content.toString());
        }

        content.clear();
        super.endElement(uri, localName, qName);
    }
Sets the locator to use when reporting errors.

@param locator The locator to use.
stroom-search/stroom-search-extraction/src/main/java/stroom/search/extraction/AbstractFieldFilter.java