public class CmsHtmlValidator extends org.htmlparser.visitors.NodeVisitor
Constructor and Description |
---|
CmsHtmlValidator() |
Modifier and Type | Method and Description |
---|---|
protected org.htmlparser.PrototypicalNodeFactory |
configureNoAutoCorrectionTags()
Internally degrades Composite tags that do have children in the DOM tree
to simple single tags.
|
java.util.List<CmsMessageContainer> |
getMessages()
Returns the validation error messages.
|
int |
getRootElementCount()
Returns the number of root elements.
|
boolean |
isBalanced()
Returns whether the validated HTML is balanced.
|
void |
validate(java.lang.String html)
Validates the given HTML string.
|
void |
visitEndTag(org.htmlparser.Tag tag) |
void |
visitTag(org.htmlparser.Tag tag) |
public CmsHtmlValidator()
public java.util.List<CmsMessageContainer> getMessages()
public int getRootElementCount()
public boolean isBalanced()
true
in case the validated HTML is balancedpublic void validate(java.lang.String html) throws org.htmlparser.util.ParserException
html
- the HTML to validateorg.htmlparser.util.ParserException
- in case parsing failspublic void visitEndTag(org.htmlparser.Tag tag)
visitEndTag
in class org.htmlparser.visitors.NodeVisitor
NodeVisitor.visitEndTag(org.htmlparser.Tag)
public void visitTag(org.htmlparser.Tag tag)
visitTag
in class org.htmlparser.visitors.NodeVisitor
NodeVisitor.visitTag(org.htmlparser.Tag)
protected org.htmlparser.PrototypicalNodeFactory configureNoAutoCorrectionTags()