Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.objectstyle.cayenne.project.validator
Class Validator

    java.lang.Object
      org.objectstyle.cayenne.project.validator.Validator

    public class Validator

extends java.lang.Object

Validator is used to validate Cayenne projects.

Author:
  Andrei Adamchik

Field Summary
`protected int` | `maxSeverity`
`protected Project` | `project`
`protected java.util.List` | `validationResults`

Constructor Summary
`Validator(Project project)` Creates a new validator initialized with the project.
`Validator(Project project, ConfigStatus status)` Initializes validator with the project loading config status.

Method Summary
`int` | `getMaxSeverity()` Returns maximum severity level encountered during the last validation run.
`Project` | `getProject()` Returns the project.
`void` | `registerError(java.lang.String message, ProjectPath treeNodePath)`
`void` | `registerValidated(int severity, java.lang.String message, ProjectPath treeNodePath)` Registers validation result.
`void` | `registerWarning(java.lang.String message, ProjectPath treeNodePath)`
`protected void` | `reset()` Resets internal state.
`int` | `validate()` Validates all project elements.
`int` | `validate(java.util.Iterator treeNodes)` Validates a set of tree nodes passed as an iterator.
`java.util.List` | `validationResults()` Return collection of ValidationInfo objects from last validation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### project

    protected Project project

### validationResults

    protected java.util.List validationResults

### maxSeverity

    protected int maxSeverity

Constructor Detail

### Validator

    public Validator(Project project)

  Creates a new validator initialized with the project.

  Parameters:
    `project` -

### Validator

    public Validator(Project project,
                     ConfigStatus status)

  Initializes validator with the project loading config status.

  Parameters:
    `project` -
    `status` -

Method Detail

### getProject

    public Project getProject()

  Returns the project.

  Returns:
    Project

### reset

    protected void reset()

  Resets internal state. Called internally before starting validation.

### getMaxSeverity

    public int getMaxSeverity()

  Returns maximum severity level encountered during the last validation run.

### registerValidated

    public void registerValidated(int severity,
                                  java.lang.String message,
                                  ProjectPath treeNodePath)

  Registers validation result. Increases internally stored max severity if `result` parameter has a higher severity then the current value. Leaves current value unchanged otherwise.

### registerError

    public void registerError(java.lang.String message,
                              ProjectPath treeNodePath)

### registerWarning

    public void registerWarning(java.lang.String message,
                                ProjectPath treeNodePath)

### validationResults

    public java.util.List validationResults()

  Return collection of ValidationInfo objects from last validation.

### validate

    public int validate()

  Validates all project elements.

  Returns:
    ValidationInfo.VALID if no errors were found, or an error code of the error with the highest severity if there were errors.

### validate

    public int validate(java.util.Iterator treeNodes)

  Validates a set of tree nodes passed as an iterator.

  Returns:
    ValidationInfo.VALID if no errors were found, or an error code of the error with the highest severity if there were errors.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 ObjectStyle.org All Rights Reserved.