Class ValidationState


  • public class ValidationState
    extends Object
    A sort of logger which can be used when traversing a schema and logging issues about it. By using the enter() and leave() methods appropriately, it keeps track of the path taken to arrive at the current position in the schema.
    Author:
    Antonin Delpeuch
    • Constructor Detail

      • ValidationState

        public ValidationState​(ColumnModel columnModel)
    • Method Detail

      • enter

        public ValidationState enter()
        Called when entering a schema element which should not be recorded in the path displayed to the user. Useful for classes like StatementGroup or SnakGroup which do not really have a user-facing counterpart.
      • enter

        public ValidationState enter​(PathElement element)
        Called when entering a schema element which should be recorded in the path displayed to the user.
      • leave

        public ValidationState leave()
        Called when leaving a schema element and returning to its parent.
      • addError

        public ValidationState addError​(String message)
        Logs an error at the current position in the schema
        Parameters:
        message - the error message
      • getColumnModel

        public ColumnModel getColumnModel()
        Returns the column model in the context of which this schema is validated.
      • getValidationErrors

        public List<ValidationError> getValidationErrors()
        Retrieves the validation errors emitted so far.