org.eclipse.mylyn.internal.wikitext.core.validation
Class StandaloneMarkupValidator

java.lang.Object
  extended by org.eclipse.mylyn.internal.wikitext.core.validation.StandaloneMarkupValidator

public class StandaloneMarkupValidator
extends Object

Validate markup given a set of rules (stand-alone, outside of an Eclipse environment)

Author:
David Green

Constructor Summary
StandaloneMarkupValidator()
           
 
Method Summary
 void computeRules(String markupLanguage)
          Compute rules for a markup language based on looking them up in the available plugin.xml files
 void computeRules(String markupLanguage, URL url)
          compute rules for the specified markup language given an URL to a plugin.xml
 List<ValidationRule> getRules()
           
static StandaloneMarkupValidator getValidator(String markupLanguage)
          Get the default validator for the specified markup language.
 void setClassLoader(ClassLoader classLoader)
          for testing purposes, set the class loader to use when loading validation rules
 List<ValidationProblem> validate(String markup)
           
 List<ValidationProblem> validate(String markup, int offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneMarkupValidator

public StandaloneMarkupValidator()
Method Detail

getValidator

public static StandaloneMarkupValidator getValidator(String markupLanguage)
Get the default validator for the specified markup language. Validators that are returned by this method are immutable and thread-safe

Parameters:
markupLanguage - the markup language for which a validator is desired
Returns:
the validator

validate

public List<ValidationProblem> validate(String markup)

validate

public List<ValidationProblem> validate(String markup,
                                        int offset,
                                        int length)

getRules

public List<ValidationRule> getRules()

computeRules

public void computeRules(String markupLanguage)
Compute rules for a markup language based on looking them up in the available plugin.xml files

Parameters:
markupLanguage -

computeRules

public void computeRules(String markupLanguage,
                         URL url)
compute rules for the specified markup language given an URL to a plugin.xml

Parameters:
markupLanguage - the markup language for which rules should be loaded
url - the URL to the plugin.xml that specifies the rules

setClassLoader

public void setClassLoader(ClassLoader classLoader)
for testing purposes, set the class loader to use when loading validation rules



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