public final class ValidatorBuilder extends Object
This is your entry point to the module. Start with creating a new validator:
HtmlValidator validator = new ValidatorBuilder().html();
Now you can use it in order to validate your HTML document against W3C rules:
ValidationResponse response = validator.validate( "<html><body>...</body></html>" );
The response contains all information provided by W3C server. You can
work with details from ValidationResponse
or just output it to
console:
System.out.println(response.toString());
ValidationResponse
,
Validator
,
W3C APIModifier and Type | Field and Description |
---|---|
static Validator |
CSS
Static instance of CSS validator.
|
static Validator |
HTML
Static instance of HTML validator.
|
Constructor and Description |
---|
ValidatorBuilder() |
Modifier and Type | Method and Description |
---|---|
Validator |
css()
Build CSS validator.
|
Validator |
css(URI uri)
Build CSS validator, pointing to the given URI of W3C engine.
|
Validator |
html()
Build HTML validator.
|
Validator |
html(URI uri)
Build HTML validator, pointing to the given URI of W3C engine.
|
public static final Validator HTML
public static final Validator CSS
public Validator html()
public Validator css()
public Validator html(URI uri)
uri
- URI of validatorCopyright © 2012–2016 jcabi.com. All rights reserved.