@Test public void testCannotParse() { final List<String> source = Arrays.asList("; blah blah", ""); assertThat(factory.canParse(1, source)).isFalse(); }
@Override public boolean canParse(final int currentIndex, final List<String> source) { boolean canParse = true; if (currentIndex > 0) { for (int i = currentIndex - 1; canParse && i >= 0; i--) { final String line = source.get(i); canParse &= (StringUtils.startsWithIgnoreCase(line, "%#define ") || StringUtils.startsWithIgnoreCase(line, "%#def ") || StringUtils.startsWithIgnoreCase(line, "%#ifndef ") || StringUtils.isBlank(line)); } } return canParse && StringUtils.startsWith(source.get(currentIndex), "/**"); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public boolean canParse(final int currentIndex, final List<String> source) { boolean canParse = true; if (currentIndex > 0) { for (int i = currentIndex - 1; canParse && i >= 0; i--) { final String line = source.get(i); canParse &= (StringUtils.startsWithIgnoreCase(line, "%#define ") || StringUtils.startsWithIgnoreCase(line, "%#def ") || StringUtils.startsWithIgnoreCase(line, "%#ifndef ") || StringUtils.isBlank(line)); } } return canParse && StringUtils.startsWith(source.get(currentIndex), "/**"); } }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public boolean canParse(final int currentIndex, final List<String> source) { boolean canParse = true; if (currentIndex > 0) { for (int i = currentIndex - 1; canParse && i >= 0; i--) { final String line = source.get(i); canParse &= (StringUtils.startsWithIgnoreCase(line, "%#define ") || StringUtils.startsWithIgnoreCase(line, "%#def ") || StringUtils.startsWithIgnoreCase(line, "%#ifndef ") || StringUtils.isBlank(line)); } } return canParse && StringUtils.startsWith(source.get(currentIndex), "/**"); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public boolean canParse(final int currentIndex, final List<String> source) { boolean canParse = true; if (currentIndex > 0) { for (int i = currentIndex - 1; canParse && i >= 0; i--) { final String line = source.get(i); canParse &= (StringUtils.startsWithIgnoreCase(line, "%#define ") || StringUtils.startsWithIgnoreCase(line, "%#def ") || StringUtils.startsWithIgnoreCase(line, "%#ifndef ") || StringUtils.isBlank(line)); } } return canParse && StringUtils.startsWith(source.get(currentIndex), "/**"); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); @Override boolean canParse(final int currentIndex, final List<String> source); @Override int getEndingIndex(); @Override IncludeDocumentation parse(final int currentIndex, final List<String> source); }
IncludeDocumentationFactory implements TopLevelDocumentationFactory<IncludeDocumentation> { @Override public boolean canParse(final int currentIndex, final List<String> source) { boolean canParse = true; if (currentIndex > 0) { for (int i = currentIndex - 1; canParse && i >= 0; i--) { final String line = source.get(i); canParse &= (StringUtils.startsWithIgnoreCase(line, "%#define ") || StringUtils.startsWithIgnoreCase(line, "%#def ") || StringUtils.startsWithIgnoreCase(line, "%#ifndef ") || StringUtils.isBlank(line)); } } return canParse && StringUtils.startsWith(source.get(currentIndex), "/**"); } IncludeDocumentationFactory();  IncludeDocumentationFactory(final DocumentationBlockIndexedSmoosher smoosher); @Override boolean canParse(final int currentIndex, final List<String> source); @Override int getEndingIndex(); @Override IncludeDocumentation parse(final int currentIndex, final List<String> source);  }