com.dlsc.flexgantt.model.scheduling

## Class DefaultModelValidator

- java.lang.Object
- - com.dlsc.flexgantt.model.scheduling.DefaultModelValidator

- All Implemented Interfaces:
    IModelValidator

      public class DefaultModelValidator
      extends Object
      implements IModelValidator

  A model validator is used to verify whether any relationships or constraints inside a given Gantt chart model have been violated. The result of the validation is a list of messages that can be added to the Gantt chart.
  Since:
    2.1
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultModelValidator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `createViolationText(IConstraint con, Violation violation)` Creates a text description of the violation of a constraint.
    `protected String` | `createViolationText(IRelationship rel)` Creates a text description of the violation of a relationship.
    `List<IMessage>` | `validate(IGanttChartModel model)` Validate the given model and produce a list of messages.
    `IMessage` | `validate(IGanttChartModel model, IConstraint con)` Validates the given single constraint and produce a message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultModelValidator

          public DefaultModelValidator()

  - ### Method Detail

    - #### validate

          public List<IMessage> validate(IGanttChartModel model)

      Description copied from interface: `IModelValidator`
      Validate the given model and produce a list of messages.
      Specified by:
        `validate` in interface `IModelValidator`
      Parameters:
        `model` - the model to verify
      Returns:
        a list of messages that can be added to the Gantt chart
      See Also:
        `AbstractGanttChart.addMessage(IMessage)`

    - #### validate

          public IMessage validate(IGanttChartModel model,
                                   IConstraint con)

      Description copied from interface: `IModelValidator`
      Validates the given single constraint and produce a message.
      Specified by:
        `validate` in interface `IModelValidator`
      Parameters:
        `model` - the model to verify
        `con` - the constraint to verify
      Returns:
        a list of messages that can be added to the Gantt chart
      See Also:
        `AbstractGanttChart.addMessage(IMessage)`

    - #### createViolationText

          protected String createViolationText(IRelationship rel)

      Creates a text description of the violation of a relationship.
      Parameters:
        `rel` - the violated relationship
      Returns:
        a text describing the violation
      Since:
        2.1

    - #### createViolationText

          protected String createViolationText(IConstraint con,
                                               Violation violation)

      Creates a text description of the violation of a constraint.
      Parameters:
        `con` - the violated constraint
        `violation` - the violation that happened
      Returns:
        a text description of the constraint violation
      Since:
        2.1

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.