Class AbstractAntiSamyScanner
java.lang.Object
org.owasp.validator.html.scan.AbstractAntiSamyScanner
- Direct Known Subclasses:
AntiSamyDOMScanner,AntiSamySAXScanner
This class defines the basic structure for each type of AntiSamy scanner. All the
scanning/filtration logic is to reside in each implementation of this class, but the
implementations should not be called directly. All scanning should be done through an
AntiSamy.scan() method invocation.- Author:
- Arshan Dabirsiaghi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected final Localeprotected static final ResourceBundleprotected final InternalPolicy -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an AntiSamy Scanner instance that uses the default AntiSamy policy file.AbstractAntiSamyScanner(Policy policy) Construct an AntiSamy Scanner instance that uses the specified AntiSamy policy. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected org.apache.xml.serialize.HTMLSerializergetHTMLSerializer(Writer w, org.apache.xml.serialize.OutputFormat format) protected org.apache.xml.serialize.OutputFormatabstract CleanResultsabstract CleanResultsprotected String
-
Field Details
-
policy
-
errorMessages
-
messages
-
locale
-
isNofollowAnchors
protected boolean isNofollowAnchors -
isNoopenerAndNoreferrerAnchors
protected boolean isNoopenerAndNoreferrerAnchors -
isValidateParamAsEmbed
protected boolean isValidateParamAsEmbed
-
-
Constructor Details
-
AbstractAntiSamyScanner
Construct an AntiSamy Scanner instance that uses the specified AntiSamy policy.- Parameters:
policy- The policy to use.
-
AbstractAntiSamyScanner
Construct an AntiSamy Scanner instance that uses the default AntiSamy policy file.- Throws:
PolicyException- thrown when there is a problem validating or parsing the policy file. Any validation errors not caught by the XML validation will be thrown with this exception.
-
-
Method Details
-
scan
- Throws:
ScanException
-
getResults
-
addError
-
getOutputFormat
protected org.apache.xml.serialize.OutputFormat getOutputFormat() -
getHTMLSerializer
protected org.apache.xml.serialize.HTMLSerializer getHTMLSerializer(Writer w, org.apache.xml.serialize.OutputFormat format) -
trim
-