registerBeforeDocument(e, t = this) {
    this.entriesBefore.push(this.wrapPreparationException(e, "An error occurred during set-up of the validation", t));
  }
Register logic which will be executed once before validating all the nodes of an AST/Langium document.
This helps to prepare or initialize some information which are required or reusable for the following checks on the AstNodes.

As an example, for validating unique fully-qualified names of nodes in the AST,
here the map for mapping names to nodes could be established.
During the usual checks on the nodes, they are put into this map with their name.

Note that this approach makes validations stateful, which is relevant e.g. when cancelling the validation.
Therefore it is recommended to clear stored information
_before_ validating an AST to validate each AST unaffected from other ASTs
AND _after_ validating the AST to free memory by information which are no longer used.

@param checkBefore a set-up function which will be called once before actually validating an AST
@param thisObj Optional object to be used as `this` when calling the validation check functions.