Package org.owasp.validator.html.model
Class Tag
java.lang.Object
org.owasp.validator.html.model.Tag
A model for HTML "tags" and the rules dictating their validation/filtration. Also contains information
about their allowed attributes.
There is also some experimental (unused) code in here for generating a valid regular expression according to a policy
file on a per-tag basis.
- Author:
- Arshan Dabirsiaghi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttributeByName
(String name) Returns anAttribute
associated with a lookup name.getName()
Returns a regular expression for validating individual tags.boolean
Indicates if the action for this tag matches the supplied actionmutateAction
(String action)
-
Constructor Details
-
Tag
-
-
Method Details
-
getAction
- Returns:
- The action for this tag which is one of
filter
,validate
orremove
.
-
isAction
Indicates if the action for this tag matches the supplied action- Parameters:
action
- The action to match against- Returns:
- True if it matches
-
mutateAction
-
getRegularExpression
Returns a regular expression for validating individual tags. Not used by the AntiSamy scanner, but you might find some use for this.- Returns:
- A regular expression for the tag, i.e., "^$", or "<hr(\s)*(width='((\w){2,3}(\%)*)'>"
-
getName
- Returns:
- The String name of the tag.
-
getAttributeByName
Returns anAttribute
associated with a lookup name.- Parameters:
name
- The name of the allowed attribute by name.- Returns:
- The
Attribute
object associated with the name, or
-