@Test void testWithDeepSection() { Section section = new Section(7); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(section); assertEquals(1, errors.size()); }
@Override public void validate(Section section) { int level = section.getLevel(); if (getInt("max_num") < level) { addLocalizedError(section.getJoinedHeaderContents(), level); } }
SectionLevelValidator extends Validator { @Override public void validate(Section section) { int level = section.getLevel(); if (getInt("max_num") < level) { addLocalizedError(section.getJoinedHeaderContents(), level); } } }
SectionLevelValidator extends Validator { @Override public void validate(Section section) { int level = section.getLevel(); if (getInt("max_num") < level) { addLocalizedError(section.getJoinedHeaderContents(), level); } } SectionLevelValidator(); }
SectionLevelValidator extends Validator { @Override public void validate(Section section) { int level = section.getLevel(); if (getInt("max_num") < level) { addLocalizedError(section.getJoinedHeaderContents(), level); } } SectionLevelValidator(); @Override void validate(Section section); }
SectionLevelValidator extends Validator { @Override public void validate(Section section) { int level = section.getLevel(); if (getInt("max_num") < level) { addLocalizedError(section.getJoinedHeaderContents(), level); } } SectionLevelValidator(); @Override void validate(Section section);  }