Package org.apache.sling.xss.impl
Class PlainTextToHtmlContentContext
- java.lang.Object
-
- org.apache.sling.xss.impl.PlainTextToHtmlContentContext
-
- All Implemented Interfaces:
XSSFilterRule
public class PlainTextToHtmlContentContext extends Object implements XSSFilterRule
Class that provides the capability of securing input provided as plain text for HTML output.
-
-
Constructor Summary
Constructors Constructor Description PlainTextToHtmlContentContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheck(PolicyHandler policy, String str)Check to see if a given string contains policy violations.Stringfilter(PolicyHandler policy, String str)Filter a given string to remove any policy violations.booleansupportsPolicy()
-
-
-
Method Detail
-
check
public boolean check(PolicyHandler policy, String str)
Description copied from interface:XSSFilterRuleCheck to see if a given string contains policy violations.- Specified by:
checkin interfaceXSSFilterRule- Parameters:
policy- the policy handler to use for filteringstr- the input to check- Returns:
- true if the source string is free of policy violations (as defined by policyHandler)
- See Also:
XSSFilterRule.check(PolicyHandler, String)
-
filter
public String filter(PolicyHandler policy, String str)
Description copied from interface:XSSFilterRuleFilter a given string to remove any policy violations.- Specified by:
filterin interfaceXSSFilterRule- Parameters:
policy- the policy handler to use for filteringstr- the input to filter- Returns:
- a filtered string which is "safe" (as defined by policyHandler)
- See Also:
XSSFilterRule.filter(PolicyHandler, java.lang.String)
-
supportsPolicy
public boolean supportsPolicy()
- Specified by:
supportsPolicyin interfaceXSSFilterRule- See Also:
XSSFilterRule.supportsPolicy()
-
-