org.eclipse.mylyn.wikitext.core.validation
Class ValidationRule

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.validation.ValidationRule
Direct Known Subclasses:
BlockWhitespaceRule, CommentValidationRule, DocumentLocalReferenceValidationRule, ListWhitespaceValidationRule, TestMarkupValidationRule

public abstract class ValidationRule
extends Object

A validation rule. Validation rules must not be stateful, as they may be used concurrently on different threads.

Author:
David Green

Constructor Summary
ValidationRule()
           
 
Method Summary
abstract  ValidationProblem findProblem(String markup, int offset, int length)
          Starting at the given offset find the next validation problem.
 List<ValidationProblem> findProblems(String markup, int offset, int length)
          Find all validation problems that exist starting at the given offset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationRule

public ValidationRule()
Method Detail

findProblem

public abstract ValidationProblem findProblem(String markup,
                                              int offset,
                                              int length)
Starting at the given offset find the next validation problem.

Parameters:
markup - the markup content in which a validation problem should be found
offset - the offset at which to start looking for problems
length - the length at which to stop looking for problems
Returns:
the validation problem if found, or null if no validation problem was detected

findProblems

public List<ValidationProblem> findProblems(String markup,
                                            int offset,
                                            int length)
Find all validation problems that exist starting at the given offset

Parameters:
markup - the markup content in which a validation problem should be found
offset - the offset at which to start looking for problems
length - the length at which to stop looking for problems
Returns:
the problems, or an empty list if there are none


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.