@Test public void testParse() { final int value = 1234; final String description = "i am the description"; final EnumeratedValue enumerated = parser.parseElement("@value " + Integer.toString(value) + " " + description); assertThat(enumerated.getValue()).isEqualTo(Integer.toString(value)); assertThat(enumerated.getDescription()).isEqualTo(description); }
@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); if (secondSpace < 0) { return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1))); } 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(); } }
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); if (secondSpace < 0) { return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1))); } 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(); } } }
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); if (secondSpace < 0) { return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1))); } 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(); } }  }
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); if (secondSpace < 0) { return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1))); } 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(); } }   }
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); if (secondSpace < 0) { return new EnumeratedValue(decodeFieldValue(line.substring(firstSpace + 1))); } 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(); } }    }