## org.eclipse.wst.validation
Class Validator.V2

    java.lang.Object
      org.eclipse.wst.validation.Validator
          org.eclipse.wst.validation.Validator.V2

All Implemented Interfaces:
  java.lang.Comparable<Validator>

Enclosing class:
  Validator

    public static final class Validator.V2

extends Validator

A validator that uses version 2 of the validation framework.

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.wst.validation.Validator
`Validator.Level, Validator.V1, Validator.V2`

Method Summary
`void` `add(org.eclipse.wst.validation.internal.model.FilterGroup fg)`
`IValidator` `asIValidator()`
`Validator.V2` `asV2Validator()` If you are a version 2 validator, answer yourself as one, otherwise answer null.
`void` `bumpChangeCountGroups()`
`void` `clean(IProject project, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor)` Let the validator know that a clean is about to happen.
`Validator` `copy(boolean includeChangeCounts)`
`java.lang.Object` `getAdapter(java.lang.Class adapter)`
`int` `getChangeCountGroups()`
`AbstractValidator` `getDelegatedValidator()` Answer the actual validator that is going to perform the validation.
`org.eclipse.wst.validation.internal.model.FilterGroup[]` `getGroups()` Answer the validator's filter groups.
`java.lang.String` `getId()`
`Validator.Level` `getLevel()`
`java.lang.String` `getName()`
`AbstractValidator` `getValidator()`
`java.lang.String` `getValidatorClassname()` Answer the name of the class that implements the validator.
`java.lang.String[]` `getValidatorGroups()`
`int` `hashCodeForConfig()` Answer a hash code for the configurable fields so that we can quickly determine if two validators are the same.
`boolean` `isChanged()` Has the validator changed since it was last created or copied?
`void` `remove(org.eclipse.wst.validation.internal.model.FilterGroup group)`
`void` `replaceFilterGroup(org.eclipse.wst.validation.internal.model.FilterGroup existing, org.eclipse.wst.validation.internal.model.FilterGroup merged)`
`void` `resetChangeCounters()`
`void` `setDelegatingId(java.lang.String delegating)` Set the id of the "real" validator, that is the validator that will be called when this delegating validator is asked to validate something.
`void` `setGroups(java.util.List<org.eclipse.wst.validation.internal.model.FilterGroup> groups)`
`void` `setId(java.lang.String id)`
`void` `setLevel(Validator.Level level)`
`void` `setName(java.lang.String name)`
`boolean` `shouldClearMarkers(ValidationEvent event)` Should the validation framework first clear the markers that this validator has placed on this resource?
`ValidationResult` `validate(IResource resource, int kind, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor)` Validate the resource.
`ValidationResult` `validate(IResource resource, int kind, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor, ValidationEvent event)` Validate the resource.
`void` `validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor)` This method will be called when validation is complete.
`void` `validationStarting(IProject project, ValidationState state, IProgressMonitor monitor)` This method will be called before any validation takes place.

Methods inherited from class org.eclipse.wst.validation.Validator

`asV1Validator, bumpChangeCountGlobal, bumpChangeCountMessages, compareTo, copy, create, create, getChangeCountGlobal, getChangeCountMessages, getDelegatingId, getMarkerId, getMessage, getMessageSettings, getProject, getSourceId, getVersion, hasGlobalChanges, isBuildValidation, isManualValidation, sameConfig, setBuildValidation, setManualValidation, setMarkerId, setSourceId, setVersion, shouldValidate, shouldValidate, shouldValidateProject, shouldValidateProject, toString`

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

Method Detail

### add

    public void add(org.eclipse.wst.validation.internal.model.FilterGroup fg)

### asIValidator

    public IValidator asIValidator()

  Overrides:
    `asIValidator` in class `Validator`

### asV2Validator

    public Validator.V2 asV2Validator()

  Description copied from class: `Validator`
  If you are a version 2 validator, answer yourself as one, otherwise answer null.

  Overrides:
    `asV2Validator` in class `Validator`

### clean

    public void clean(IProject project,
                      org.eclipse.wst.validation.internal.ValOperation operation,
                      IProgressMonitor monitor)

  Let the validator know that a clean is about to happen.

  Overrides:
    `clean` in class `Validator`
  Parameters:
    `project` - the project that is being cleaned. This can be null which means that the workspace is being cleaned (in which case a separate call will be made for each open project).
    `monitor` - the monitor that should be used for reporting progress if the clean takes a long time.

### copy

    public Validator copy(boolean includeChangeCounts)

  Specified by:
    `copy` in class `Validator`

### getChangeCountGroups

    public int getChangeCountGroups()

### bumpChangeCountGroups

    public void bumpChangeCountGroups()

### getLevel

    public Validator.Level getLevel()

### setLevel

    public void setLevel(Validator.Level level)

### getDelegatedValidator

    public AbstractValidator getDelegatedValidator()

  Answer the actual validator that is going to perform the validation. If this is a normal validator this method will simply answer itself. However if this is a delegating validator, then this will answer the "real" validator.

### getId

    public java.lang.String getId()

  Specified by:
    `getId` in class `Validator`

### getGroups

    public org.eclipse.wst.validation.internal.model.FilterGroup[] getGroups()

  Answer the validator's filter groups.

  Returns:
    an empty array if the validator does not have any filter groups.

### getName

    public java.lang.String getName()

  Specified by:
    `getName` in class `Validator`

### getValidator

    public AbstractValidator getValidator()

### getValidatorClassname

    public java.lang.String getValidatorClassname()

  Description copied from class: `Validator`
  Answer the name of the class that implements the validator.

  Specified by:
    `getValidatorClassname` in class `Validator`

### getValidatorGroups

    public java.lang.String[] getValidatorGroups()

### hashCodeForConfig

    public int hashCodeForConfig()

  Description copied from class: `Validator`
  Answer a hash code for the configurable fields so that we can quickly determine if two validators are the same.

  Overrides:
    `hashCodeForConfig` in class `Validator`

### isChanged

    public boolean isChanged()

  Description copied from class: `Validator`
  Has the validator changed since it was last created or copied? Or was it migrated from an earlier version.

  Overrides:
    `isChanged` in class `Validator`

### shouldClearMarkers

    public boolean shouldClearMarkers(ValidationEvent event)

  Description copied from class: `Validator`
  Should the validation framework first clear the markers that this validator has placed on this resource? This method can be overridden by validator implementors to provide a validator specific behavior.

  Overrides:
    `shouldClearMarkers` in class `Validator`
  Parameters:
    `event` - The validation event that triggered the validation.
  Returns:
    true if the validation framework should first clear all the markers that this validator produced. This is the default behavior. Return false to leave the markers unchanged. It then becomes the responsibility of the validator to manage it's own markers for this resource, for this validation event.

### setDelegatingId

    public void setDelegatingId(java.lang.String delegating)

  Description copied from class: `Validator`
  Set the id of the "real" validator, that is the validator that will be called when this delegating validator is asked to validate something.

  Overrides:
    `setDelegatingId` in class `Validator`
  Parameters:
    `delegating` - the id of the validator that is actually going to perform the validation.

### setGroups

    public void setGroups(java.util.List<org.eclipse.wst.validation.internal.model.FilterGroup> groups)

### setId

    public void setId(java.lang.String id)

### setName

    public void setName(java.lang.String name)

### validate

    public ValidationResult validate(IResource resource,
                                     int kind,
                                     org.eclipse.wst.validation.internal.ValOperation operation,
                                     IProgressMonitor monitor)

  Description copied from class: `Validator`
  Validate the resource.

  Specified by:
    `validate` in class `Validator`
  Parameters:
    `resource` - The resource to be validated.
    `kind` - The kind of resource change, see IResourceDelta for values.
    `operation` - The operation that this validation is running under. This can be null.
    `monitor` - A way to report progress. This can be null.
  Returns:
    the result of doing the validation, it can be, but usually isn't null.

### validate

    public ValidationResult validate(IResource resource,
                                     int kind,
                                     org.eclipse.wst.validation.internal.ValOperation operation,
                                     IProgressMonitor monitor,
                                     ValidationEvent event)

  Description copied from class: `Validator`
  Validate the resource.

  Overrides:
    `validate` in class `Validator`
  Parameters:
    `resource` - The resource to be validated.
    `kind` - The kind of resource change, see IResourceDelta for values.
    `operation` - The operation that this validation is running under. This can be null.
    `monitor` - A way to report progress. This can be null.
    `event` - An event that describes in more detail what should be validated and why it should be validated. This can be null.
  Returns:
    the result of doing the validation, it can be, but usually isn't null.

### validationStarting

    public void validationStarting(IProject project,
                                   ValidationState state,
                                   IProgressMonitor monitor)

  Description copied from class: `Validator`
  This method will be called before any validation takes place. It allows validators to perform any initialization that they might need.

  Overrides:
    `validationStarting` in class `Validator`
  Parameters:
    `project` - the project that is being validated. For the very first call in the validation phase, this will be null. That is the signal to the validator that a top level validation is starting. Subsequently, the project will be set, as each of the individual projects are validated.
    `state` - a way to pass arbitrary, validator specific, data from one invocation of a validator to the next, during the validation phase.
    `monitor` - the monitor that should be used for reporting progress if the clean takes a long time.

### validationFinishing

    public void validationFinishing(IProject project,
                                    ValidationState state,
                                    IProgressMonitor monitor)

  Description copied from class: `Validator`
  This method will be called when validation is complete. It allows validators to perform any cleanup that they might need to do.

  Overrides:
    `validationFinishing` in class `Validator`
  Parameters:
    `project` - the project that was validated. The very last call in the validation will set this to null so that the validator knows that all the projects have now been validated.
    `state` - a way to pass arbitrary, validator specific, data from one invocation of a validator to the next, during the validation phase.
    `monitor` - the monitor that should be used for reporting progress if the clean takes a long time.

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class adapter)

### remove

    public void remove(org.eclipse.wst.validation.internal.model.FilterGroup group)

### resetChangeCounters

    public void resetChangeCounters()

  Overrides:
    `resetChangeCounters` in class `Validator`

### replaceFilterGroup

    public void replaceFilterGroup(org.eclipse.wst.validation.internal.model.FilterGroup existing,
                                   org.eclipse.wst.validation.internal.model.FilterGroup merged)