Package org.owasp.validator.html.scan
Class AntiSamyDOMScanner
- java.lang.Object
-
- org.owasp.validator.html.scan.AbstractAntiSamyScanner
-
- org.owasp.validator.html.scan.AntiSamyDOMScanner
-
public class AntiSamyDOMScanner extends AbstractAntiSamyScanner
This is where the magic lives. All the scanning/filtration logic resides here, but it should not be called directly. All scanning should be done through aAntiSamy.scan()
method.- Author:
- Arshan Dabirsiaghi
-
-
Field Summary
-
Fields inherited from class org.owasp.validator.html.scan.AbstractAntiSamyScanner
errorMessages, isNofollowAnchors, isValidateParamAsEmbed, locale, messages, policy
-
-
Constructor Summary
Constructors Constructor Description AntiSamyDOMScanner()
AntiSamyDOMScanner(Policy policy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CleanResults
getResults()
static void
main(java.lang.String[] args)
CleanResults
scan(java.lang.String html)
This is where the magic lives.-
Methods inherited from class org.owasp.validator.html.scan.AbstractAntiSamyScanner
addError, getHTMLSerializer, getOutputFormat, trim
-
-
-
-
Constructor Detail
-
AntiSamyDOMScanner
public AntiSamyDOMScanner(Policy policy)
-
AntiSamyDOMScanner
public AntiSamyDOMScanner() throws PolicyException
- Throws:
PolicyException
-
-
Method Detail
-
scan
public CleanResults scan(java.lang.String html) throws ScanException
This is where the magic lives.- Specified by:
scan
in classAbstractAntiSamyScanner
- Parameters:
html
- A String whose contents we want to scan.- Returns:
- A
CleanResults
object with anXMLDocumentFragment
object and its String representation, as well as some scan statistics. - Throws:
ScanException
-
main
public static void main(java.lang.String[] args) throws PolicyException
- Throws:
PolicyException
-
getResults
public CleanResults getResults()
- Specified by:
getResults
in classAbstractAntiSamyScanner
-
-