Description
Our current validator logic relies on parent statements being aware of their possible children. This does not really work as it requires knowledge of all statements – which is not possible due to YANG being an extensible language.
Substatement validation needs to occur the other way around: children should check whether they are defined underneath correct parent. We already do this sort of check in StatementSupport.onStatementAdded() – which is completely satisfactory, except we need to make it much more friendly (for example by providing a default implementation, which checks if parent's StatementDefinition is in a set.