org.owasp.validator.html.model
Class Attribute

java.lang.Object
  extended by org.owasp.validator.html.model.Attribute
All Implemented Interfaces:
java.lang.Cloneable

public class Attribute
extends java.lang.Object
implements java.lang.Cloneable

A model for HTML attributes and the "rules" they must follow (either literals or regular expressions) in order to be considered valid.

Author:
Arshan Dabirsiaghi

Constructor Summary
Attribute(java.lang.String name)
           
 
Method Summary
 void addAllowedRegExp(java.util.regex.Pattern safeRegExpValue)
           
 void addAllowedValue(java.lang.String safeValue)
           
 java.lang.Object clone()
          We need to implement clone() to make the Policy file work with common attributes and the ability to use a common-attribute with an alternative onInvalid action.
 java.util.List getAllowedRegExp()
           
 java.util.List getAllowedValues()
           
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 java.lang.String getOnInvalid()
           
 void setAllowedRegExp(java.util.List allowedRegExp)
           
 void setAllowedValues(java.util.List allowedValues)
           
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
           
 void setOnInvalid(java.lang.String onInvalid)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String name)
Method Detail

addAllowedValue

public void addAllowedValue(java.lang.String safeValue)
Parameters:
safeValue - A legal literal value that an attribute can have, according to the Policy

addAllowedRegExp

public void addAllowedRegExp(java.util.regex.Pattern safeRegExpValue)
Parameters:
safeRegExpValue - A legal regular expression value that an attribute could have, according to the Policy

getAllowedRegExp

public java.util.List getAllowedRegExp()
Returns:
A List of regular expressions that an attribute can be validated from.

setAllowedRegExp

public void setAllowedRegExp(java.util.List allowedRegExp)
Parameters:
allowedRegExp - A List of regular expressions that an attribute can be validated from.

getAllowedValues

public java.util.List getAllowedValues()
Returns:
A List of literal values that an attribute could have, according to the Policy.

setAllowedValues

public void setAllowedValues(java.util.List allowedValues)
Parameters:
allowedValues - A List of regular expressions that an attribute can be validated from.

getName

public java.lang.String getName()
Returns:
The name of an Attribute object.

setName

public void setName(java.lang.String name)
Parameters:
name - The new name of an Attribute object.

getOnInvalid

public java.lang.String getOnInvalid()
Returns:
The onInvalid value a tag could have, from the list of "filterTag", "removeTag" and "removeAttribute"

setOnInvalid

public void setOnInvalid(java.lang.String onInvalid)
Parameters:
onInvalid - The new onInvalid value of an Attribute object.

getDescription

public java.lang.String getDescription()
Returns:
The description of what the tag does.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The new description of what the tag does.

clone

public java.lang.Object clone()
We need to implement clone() to make the Policy file work with common attributes and the ability to use a common-attribute with an alternative onInvalid action.

Overrides:
clone in class java.lang.Object


Copyright © 2010 The Open Web Application Security Project (OWASP). All Rights Reserved.