|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.owasp.validator.html.Policy
public class Policy
Policy.java This file holds the model for our policy engine.
| Field Summary | |
|---|---|
static java.lang.String |
ACTION_FILTER
|
static java.lang.String |
ACTION_TRUNCATE
|
static java.lang.String |
ACTION_VALIDATE
|
static java.lang.String |
ANCHORS_NOFOLLOW
|
static java.util.regex.Pattern |
ANYTHING_REGEXP
|
static java.lang.String |
CONNECTION_TIMEOUT
|
static int |
DEFAULT_MAX_INPUT_SIZE
|
static int |
DEFAULT_MAX_STYLESHEET_IMPORTS
|
static java.lang.String |
EMBED_STYLESHEETS
|
static java.lang.String |
ENCODE_TAGS
|
static java.lang.String |
FORMAT_OUTPUT
|
static java.lang.String |
MAX_INPUT_SIZE
|
static java.lang.String |
OMIT_DOCTYPE_DECLARATION
|
static java.lang.String |
OMIT_XML_DECLARATION
|
static java.lang.String |
PRESERVE_COMMENTS
|
static java.lang.String |
PRESERVE_SPACE
|
static java.lang.String |
USE_XHTML
|
static java.lang.String |
VALIDATE_PARAM_AS_EMBED
|
| Method Summary | |
|---|---|
java.lang.String |
getDirective(java.lang.String name)
Return a directive value based on a lookup name. |
Attribute |
getGlobalAttributeByName(java.lang.String name)
A simple method for returning on of the |
static Policy |
getInstance()
This retrieves a Policy based on a default location ("resources/antisamy.xml") |
static Policy |
getInstance(java.io.File file)
This retrieves a Policy based on the File object passed in |
static Policy |
getInstance(java.io.InputStream inputStream)
This retrieves a Policy based on the InputStream object passed in |
static Policy |
getInstance(java.lang.String filename)
This retrieves a Policy based on the file name passed in |
int |
getMaxInputSize()
Returns the maximum input size. |
Property |
getPropertyByName(java.lang.String propertyName)
Retrieves a CSS Property from the Policy. |
AntiSamyPattern |
getRegularExpression(java.lang.String name)
A simple method for returning on of the |
Tag |
getTagByName(java.lang.String tagName)
Retrieves a Tag from the Policy. |
java.lang.String[] |
getTags()
Return all the tags accepted by the Policy object. |
boolean |
isTagInListToEncode(java.lang.String s)
|
static void |
main(java.lang.String[] args)
Main test unit. |
void |
setDirective(java.lang.String name,
java.lang.String value)
Set a directive for a value based on a name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.regex.Pattern ANYTHING_REGEXP
public static final int DEFAULT_MAX_INPUT_SIZE
public static final int DEFAULT_MAX_STYLESHEET_IMPORTS
public static final java.lang.String OMIT_XML_DECLARATION
public static final java.lang.String OMIT_DOCTYPE_DECLARATION
public static final java.lang.String MAX_INPUT_SIZE
public static final java.lang.String USE_XHTML
public static final java.lang.String FORMAT_OUTPUT
public static final java.lang.String EMBED_STYLESHEETS
public static final java.lang.String CONNECTION_TIMEOUT
public static final java.lang.String ANCHORS_NOFOLLOW
public static final java.lang.String VALIDATE_PARAM_AS_EMBED
public static final java.lang.String PRESERVE_SPACE
public static final java.lang.String PRESERVE_COMMENTS
public static final java.lang.String ENCODE_TAGS
public static final java.lang.String ACTION_VALIDATE
public static final java.lang.String ACTION_FILTER
public static final java.lang.String ACTION_TRUNCATE
| Method Detail |
|---|
public boolean isTagInListToEncode(java.lang.String s)
public Tag getTagByName(java.lang.String tagName)
tagName - The name of the Tag to look up.
public Property getPropertyByName(java.lang.String propertyName)
propertyName - The name of the CSS Property to look up.
public static Policy getInstance()
throws PolicyException
PolicyException - If the file is not found or there is a problem parsing the file.
public static Policy getInstance(java.lang.String filename)
throws PolicyException
filename - The path to the XML policy file.
PolicyException - If the file is not found or there is a problem parsing the file.
public static Policy getInstance(java.io.File file)
throws PolicyException
file - A File object which contains the XML policy information.
PolicyException - If the file is not found or there is a problem parsing the file.
public static Policy getInstance(java.io.InputStream inputStream)
throws PolicyException
inputStream - An InputStream which contains thhe XML policy information.
PolicyException - If there is a problem parsing the input stream.public AntiSamyPattern getRegularExpression(java.lang.String name)
name - The name of the common regexp we want to look up.
public Attribute getGlobalAttributeByName(java.lang.String name)
name - The name of the global-attribute we want to look up.
public java.lang.String[] getTags()
public java.lang.String getDirective(java.lang.String name)
public void setDirective(java.lang.String name,
java.lang.String value)
name - A directive to set a value for.value - The new value for the directive.public int getMaxInputSize()
DEFAULT_MAX_INPUT_SIZE is used.
public static void main(java.lang.String[] args)
throws java.lang.Exception
args -
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||