class EnumeratedValueParser extends AbstractMultiTagParser<EnumeratedValue> {

    @Override
    protected EnumeratedValue parseElement(final String line) {
        final EtmPoint point = PointFactory.getPoint(getClass(), "parseElement(String)");
        try {
            final int firstSpace = line.indexOf(' ');
            if (firstSpace < 0) {
                throw new InvalidDocumentationException("No space found in value definition: " + line);
            }

            final int secondSpace = line.indexOf(' ', firstSpace + 1);
            // No documentation, just the value
            if (secondSpace < 0) {
                return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1)));
            }
            // If it's a string value, then find the location of the very last quotation mark
            if (line.charAt(firstSpace + 1) == '"') {
                return getStringValue(firstSpace + 1, line);
            }

            final String fieldValue = decodeFieldValue(line.substring(firstSpace + 1, secondSpace));
            final String description = line.substring(secondSpace + 1);
            return new EnumeratedValue(fieldValue, description);
        } finally {
            point.collect();
        }
    }

}