public class EmbeddedValidator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EmbeddedValidator.OutputFormat |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCHEMA_URL |
Constructor and Description |
---|
EmbeddedValidator() |
Modifier and Type | Method and Description |
---|---|
int |
getLineOffset() |
EmbeddedValidator.OutputFormat |
getOutputFormat() |
java.lang.String |
getSchemaUrl() |
boolean |
isAsciiQuotes() |
boolean |
isForceHTML() |
boolean |
isLoadEntities() |
boolean |
isNoLangDetect() |
boolean |
isNoStream() |
void |
setAsciiQuotes(boolean asciiQuotes) |
void |
setForceHTML(boolean forceHTML) |
void |
setLineOffset(int lineOffset) |
void |
setLoadEntities(boolean loadEntities) |
void |
setNoLangDetect(boolean noLangDetect) |
void |
setNoStream(boolean noStream) |
void |
setOutputFormat(EmbeddedValidator.OutputFormat outputFormat)
Set the output format for the validation
|
void |
setSchemaUrl(java.lang.String schemaUrl)
Default value is "http://s.validator.nu/html5-rdfalite.rnc"
|
java.lang.String |
validate(java.io.InputStream in)
Validate the input source
|
java.lang.String |
validate(java.nio.file.Path path)
Validate the file at the given path
|
public static final java.lang.String SCHEMA_URL
public java.lang.String validate(java.nio.file.Path path) throws java.io.IOException, org.xml.sax.SAXException
path
- a valid Path
to a readable fileString
java.lang.IllegalStateException
java.io.IOException
org.xml.sax.SAXException
public java.lang.String validate(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
in
- a valid InputStream
to a readable fileString
java.lang.IllegalStateException
java.io.IOException
org.xml.sax.SAXException
public EmbeddedValidator.OutputFormat getOutputFormat()
public void setOutputFormat(EmbeddedValidator.OutputFormat outputFormat)
outputFormat
- EmbeddedValidator.OutputFormat
, not null
java.lang.IllegalArgumentException
- if argument is null
public boolean isLoadEntities()
public void setLoadEntities(boolean loadEntities)
loadEntities
- true
to have XML parser load remote DTDs, etcpublic boolean isNoLangDetect()
public void setNoLangDetect(boolean noLangDetect)
detectLanguages
- true
to enable language detection, false
to
disable language detectionpublic boolean isNoStream()
public void setNoStream(boolean noStream)
noStream
- if true
, HTML parser will buffer instead of streamingpublic boolean isForceHTML()
public void setForceHTML(boolean forceHTML)
forceHTML
- if true
, input will be validated as HTML regardless of
its actual document typepublic boolean isAsciiQuotes()
public void setAsciiQuotes(boolean asciiQuotes)
asciiQuotes
- true
if curly quotes ('‘'
&
'’'
) in emitted warnings and errors should be
replaced with ascii quotespublic int getLineOffset()
public void setLineOffset(int lineOffset)
lineOffset
- offset to add or subtract from the line number in emitted
warnings and errorspublic java.lang.String getSchemaUrl()
public void setSchemaUrl(java.lang.String schemaUrl)
schemaUrl
- url to the required schema