|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.wst.validation.Validator
public abstract class Validator
Represents a validator. This gets instantiated through one of the validator extension points.
This class is not API.
Nested Class Summary | |
---|---|
static class |
Validator.Level
The level of configuration for the validator. |
static class |
Validator.V1
A validator that uses version 1 of the validation framework. |
static class |
Validator.V2
A validator that uses version 2 of the validation framework. |
Constructor Summary | |
---|---|
Validator(IProject project)
|
Method Summary | |
---|---|
IValidator |
asIValidator()
|
Validator.V1 |
asV1Validator()
If you are a version 1 validator, answer yourself as one, otherwise answer null. |
Validator.V2 |
asV2Validator()
If you are a version 2 validator, answer yourself as one, otherwise answer null. |
void |
bumpChangeCountGlobal()
|
void |
bumpChangeCountMessages()
|
void |
clean(IProject project,
org.eclipse.wst.validation.internal.ValOperation operation,
IProgressMonitor monitor)
The project is being cleaned, this method gives the validator a chance to do any special cleanup. |
int |
compareTo(Validator validator)
Compare yourself based on Validator name. |
Validator |
copy()
Answer a deep copy of yourself. |
abstract Validator |
copy(boolean includeChangeCounts)
|
static Validator |
create(IConfigurationElement validator,
IProject project)
Create a new validator based on a abstract validator. |
static Validator |
create(ValidatorMetaData vmd,
ValidationConfiguration config,
IProject project)
Create a new validator based on validator meta data. |
int |
getChangeCountGlobal()
|
int |
getChangeCountMessages()
|
java.lang.String |
getDelegatingId()
Get the id of the "real" validator, that is the validator that will be called when this delegating validator is asked to validate something. |
abstract java.lang.String |
getId()
|
java.lang.String |
getMarkerId()
|
MessageSeveritySetting |
getMessage(java.lang.String id)
|
java.util.Map<java.lang.String,MessageSeveritySetting> |
getMessageSettings()
Answer all the message settings that this validator has defined. |
abstract java.lang.String |
getName()
|
IProject |
getProject()
Answer the project that you were enabled on. |
java.lang.String |
getSourceId()
|
abstract java.lang.String |
getValidatorClassname()
Answer the name of the class that implements the validator. |
int |
getVersion()
|
boolean |
hasGlobalChanges()
|
int |
hashCodeForConfig()
Answer a hash code for the configurable fields so that we can quickly determine if two validators are the same. |
boolean |
isBuildValidation()
Is this validator currently enabled for validations that are triggered by builds? |
boolean |
isChanged()
Has the validator changed since it was last created or copied? |
boolean |
isManualValidation()
Is this validator currently enabled for validations that are triggered manually? |
void |
resetChangeCounters()
|
boolean |
sameConfig(Validator validator)
Answer true if you have the same configuration settings as validator. |
boolean |
setBuildValidation(boolean buildValidation)
Set whether this validator should be triggered by the build process. |
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. |
boolean |
setManualValidation(boolean manualValidation)
Set whether this validator should be triggered as part of a manual validation. |
void |
setMarkerId(java.lang.String markerId)
|
void |
setSourceId(java.lang.String sourceId)
|
void |
setVersion(int version)
|
boolean |
shouldClearMarkers(ValidationEvent event)
Should the validation framework first clear the markers that this validator has placed on this resource? |
boolean |
shouldValidate(IResource resource,
boolean isManual,
boolean isBuild)
Answer true if this validator, based on it's filters, should validate this resource. |
boolean |
shouldValidate(IResource resource,
org.eclipse.wst.validation.internal.ValType valType)
Answer true if this validator, based on it's filters, should validate this resource. |
boolean |
shouldValidateProject(IProject project,
boolean isManual,
boolean isBuild)
Answer true if this validator, based on it's filters, should validate this project. |
boolean |
shouldValidateProject(IProject project,
org.eclipse.wst.validation.internal.ValType type)
Answer true if this validator, based on it's filters, should validate this project. |
java.lang.String |
toString()
|
abstract 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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Validator(IProject project)
Method Detail |
---|
public static Validator create(IConfigurationElement validator, IProject project)
validator
- The validator that is being wrapped.project
- The project that you are defined in. This can be null which
means that you are a global validator.public static Validator create(ValidatorMetaData vmd, ValidationConfiguration config, IProject project)
project
- The project that you are defined in. This can be null which
means that you are a global validator.public Validator.V1 asV1Validator()
public Validator.V2 asV2Validator()
public void clean(IProject project, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor)
project
- the project being built.monitor
- the monitor that should be used for reporting progress if the clean takes a long time.public int compareTo(Validator validator)
compareTo
in interface java.lang.Comparable<Validator>
public Validator copy()
public abstract Validator copy(boolean includeChangeCounts)
public boolean shouldClearMarkers(ValidationEvent event)
event
- The validation event that triggered the validation.
public boolean shouldValidate(IResource resource, boolean isManual, boolean isBuild)
resource
- The resource to be checked.isManual
- If true then this validator must also be enabled for manual
validation.isBuild
- If true then this validator must also be enabled for builder
based validation.
public boolean shouldValidate(IResource resource, org.eclipse.wst.validation.internal.ValType valType)
resource
- The resource to be checked.valType
- The context to use when performing the check.
public boolean shouldValidateProject(IProject project, org.eclipse.wst.validation.internal.ValType type)
project
- the project to be checkedtype
- The type of validation request
public boolean shouldValidateProject(IProject project, boolean isManual, boolean isBuild)
project
- the project to be checkedisManual
- if true then this validator must also be enabled for manual validation.isBuild
- if true then this validator must also be enabled for builder based validation.
public abstract ValidationResult validate(IResource resource, int kind, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor)
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.
public ValidationResult validate(IResource resource, int kind, org.eclipse.wst.validation.internal.ValOperation operation, IProgressMonitor monitor, ValidationEvent event)
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.
public void validationStarting(IProject project, ValidationState state, IProgressMonitor monitor)
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.public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor)
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.public IValidator asIValidator()
public abstract java.lang.String getId()
public MessageSeveritySetting getMessage(java.lang.String id)
public java.util.Map<java.lang.String,MessageSeveritySetting> getMessageSettings()
public int hashCodeForConfig()
public abstract java.lang.String getName()
public IProject getProject()
public abstract java.lang.String getValidatorClassname()
public boolean isManualValidation()
public boolean setManualValidation(boolean manualValidation)
manualValidation
-
public boolean isBuildValidation()
public boolean isChanged()
public boolean setBuildValidation(boolean buildValidation)
buildValidation
-
public java.lang.String getDelegatingId()
public void setDelegatingId(java.lang.String delegating)
delegating
- the id of the validator that is actually going to perform the validation.public int getVersion()
public void setVersion(int version)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSourceId()
public void setSourceId(java.lang.String sourceId)
public int getChangeCountGlobal()
public boolean hasGlobalChanges()
public int getChangeCountMessages()
public void bumpChangeCountMessages()
public void resetChangeCounters()
public void bumpChangeCountGlobal()
public boolean sameConfig(Validator validator)
validator
- this can be null.public java.lang.String getMarkerId()
public void setMarkerId(java.lang.String markerId)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |