private void validateChapter()

in src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java [85:103]


    private void validateChapter( ValidationResult result, Chapter chapter )
    {
        if ( StringUtils.isEmpty( chapter.getId() ) )
        {
            result.getErrors().add( "Each chapter has to have an id." );

            return;
        }

        if ( StringUtils.isEmpty( chapter.getTitle() ) )
        {
            result.getErrors().add( "Missing title. Chapter id: " + chapter.getId() );
        }

        if ( chapter.getSections().size() == 0 )
        {
            result.getErrors().add( "Chapter doesn't have any sections. Chapter id: " + chapter.getId() );
        }
    }