Package org.owasp.validator.html.scan
Class MagicSAXFilter
- java.lang.Object
-
- org.cyberneko.html.filters.DefaultFilter
-
- org.owasp.validator.html.scan.MagicSAXFilter
-
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLComponent
,org.apache.xerces.xni.parser.XMLDocumentFilter
,org.apache.xerces.xni.parser.XMLDocumentSource
,org.apache.xerces.xni.XMLDocumentHandler
,org.cyberneko.html.HTMLComponent
public class MagicSAXFilter extends org.cyberneko.html.filters.DefaultFilter implements org.apache.xerces.xni.parser.XMLDocumentFilter
Implementation of an HTML-filter that adheres to an AntiSamy policy. This filter is SAX-based which means it is much more memory-efficient and also a bit faster than the DOM-based implementation.
-
-
Constructor Summary
Constructors Constructor Description MagicSAXFilter(java.util.ResourceBundle messages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
void
comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs)
void
doctypeDecl(java.lang.String root, java.lang.String publicId, java.lang.String systemId, org.apache.xerces.xni.Augmentations augs)
void
emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
void
endCDATA(org.apache.xerces.xni.Augmentations augs)
void
endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)
java.util.List<java.lang.String>
getErrorMessages()
void
processingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs)
void
reset(InternalPolicy instance)
void
startCDATA(org.apache.xerces.xni.Augmentations augs)
void
startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)
-
Methods inherited from class org.cyberneko.html.filters.DefaultFilter
endDocument, endGeneralEntity, endPrefixMapping, getDocumentHandler, getDocumentSource, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, ignorableWhitespace, merge, reset, setDocumentHandler, setDocumentSource, setFeature, setProperty, startDocument, startDocument, startGeneralEntity, startPrefixMapping, textDecl, xmlDecl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
reset
public void reset(InternalPolicy instance)
-
characters
public void characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
characters
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
characters
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
comment
public void comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
comment
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
comment
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
doctypeDecl
public void doctypeDecl(java.lang.String root, java.lang.String publicId, java.lang.String systemId, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
doctypeDecl
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
doctypeDecl
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
emptyElement
public void emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
emptyElement
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
emptyElement
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
endElement
public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
endElement
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
endElement
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
processingInstruction
public void processingInstruction(java.lang.String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
processingInstruction
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
processingInstruction
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
startCDATA
public void startCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
startCDATA
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
startCDATA
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
endCDATA
public void endCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
endCDATA
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
endCDATA
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
startElement
public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
- Specified by:
startElement
in interfaceorg.apache.xerces.xni.XMLDocumentHandler
- Overrides:
startElement
in classorg.cyberneko.html.filters.DefaultFilter
- Throws:
org.apache.xerces.xni.XNIException
-
getErrorMessages
public java.util.List<java.lang.String> getErrorMessages()
-
-