Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.project.validator
Class Validator  view Validator download Validator.java

java.lang.Object
  extended byorg.objectstyle.cayenne.project.validator.Validator

public class Validator
extends java.lang.Object

Validator is used to validate Cayenne projects.


Field Summary
protected  int maxSeverity
           
protected  org.objectstyle.cayenne.project.Project project
           
protected  java.util.List validationResults
           
 
Constructor Summary
Validator(org.objectstyle.cayenne.project.Project project)
          Creates a new validator initialized with the project.
Validator(org.objectstyle.cayenne.project.Project project, org.objectstyle.cayenne.conf.ConfigStatus status)
          Initializes validator with the project loading config status.
 
Method Summary
 int getMaxSeverity()
          Returns maximum severity level encountered during the last validation run.
 org.objectstyle.cayenne.project.Project getProject()
          Returns the project.
 void registerError(java.lang.String message, org.objectstyle.cayenne.project.ProjectPath treeNodePath)
           
 void registerValidated(int severity, java.lang.String message, org.objectstyle.cayenne.project.ProjectPath treeNodePath)
          Registers validation result.
 void registerWarning(java.lang.String message, org.objectstyle.cayenne.project.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 org.objectstyle.cayenne.project.Project project

validationResults

protected java.util.List validationResults

maxSeverity

protected int maxSeverity
Constructor Detail

Validator

public Validator(org.objectstyle.cayenne.project.Project project)
Creates a new validator initialized with the project.


Validator

public Validator(org.objectstyle.cayenne.project.Project project,
                 org.objectstyle.cayenne.conf.ConfigStatus status)
Initializes validator with the project loading config status.

Method Detail

getProject

public org.objectstyle.cayenne.project.Project getProject()
Returns the 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,
                              org.objectstyle.cayenne.project.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,
                          org.objectstyle.cayenne.project.ProjectPath treeNodePath)

registerWarning

public void registerWarning(java.lang.String message,
                            org.objectstyle.cayenne.project.ProjectPath treeNodePath)

validationResults

public java.util.List validationResults()
Return collection of ValidationInfo objects from last validation.


validate

public int validate()
Validates all project elements.


validate

public int validate(java.util.Iterator treeNodes)
Validates a set of tree nodes passed as an iterator.