|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.htmlcleaner.CleanerProperties
public class CleanerProperties
Properties defining cleaner's behaviour
Field Summary | |
---|---|
static String |
BOOL_ATT_EMPTY
|
static String |
BOOL_ATT_SELF
|
static String |
BOOL_ATT_TRUE
|
static String |
DEFAULT_CHARSET
|
Constructor Summary | |
---|---|
CleanerProperties()
|
|
CleanerProperties(ITagInfoProvider tagInfoProvider)
|
Method Summary | |
---|---|
void |
addHtmlModificationListener(HtmlModificationListener listener)
Adds a listener to the list of objects that will be notified about changes that cleaner does during cleanup process. |
void |
addPruneTagNodeCondition(ITagNodeCondition condition)
Adds the condition to existing prune tag set. |
void |
fireConditionModification(ITagNodeCondition condition,
TagNode tagNode)
Fired when cleaner modifies html due to ITagNodeCondition match. |
void |
fireHtmlError(boolean certainty,
TagNode startTagToken,
ErrorType type)
Fired when cleaner fixes some error in html syntax. |
void |
fireUglyHtml(boolean certainty,
TagNode startTagToken,
ErrorType errorType)
Fired when cleaner fixes ugly html -- when syntax was correct but task was implemented by weird code. |
void |
fireUserDefinedModification(boolean certainty,
TagNode tagNode,
ErrorType errorType)
Fired when cleaner modifies html due to user specified rules. |
String |
getAllowTags()
|
Set<ITagNodeCondition> |
getAllowTagSet()
|
String |
getBooleanAttributeValues()
|
String |
getCharset()
|
CleanerTransformations |
getCleanerTransformations()
|
String |
getHyphenReplacementInComment()
|
String |
getPruneTags()
|
Set<ITagNodeCondition> |
getPruneTagSet()
|
ITagInfoProvider |
getTagInfoProvider()
|
boolean |
isAddNewlineToHeadAndBody()
|
boolean |
isAdvancedXmlEscape()
|
boolean |
isAllowHtmlInsideAttributes()
|
boolean |
isAllowMultiWordAttributes()
|
boolean |
isDeserializeEntities()
|
boolean |
isIgnoreQuestAndExclam()
|
boolean |
isKeepWhitespaceAndCommentsInHead()
|
boolean |
isNamespacesAware()
|
boolean |
isOmitCdataOutsideScriptAndStyle()
|
boolean |
isOmitComments()
|
boolean |
isOmitDeprecatedTags()
|
boolean |
isOmitDoctypeDeclaration()
|
boolean |
isOmitHtmlEnvelope()
|
boolean |
isOmitUnknownTags()
|
boolean |
isOmitXmlDeclaration()
|
boolean |
isRecognizeUnicodeChars()
|
boolean |
isTranslateSpecialEntities()
|
boolean |
isTransResCharsToNCR()
|
boolean |
isTransSpecialEntitiesToNCR()
|
boolean |
isTreatDeprecatedTagsAsContent()
|
boolean |
isTreatUnknownTagsAsContent()
|
boolean |
isUseCdataForScriptAndStyle()
|
boolean |
isUseEmptyElementTags()
|
void |
reset()
advancedXmlEscape = true; useCdataForScriptAndStyle = true; translateSpecialEntities = true; recognizeUnicodeChars = true; omitUnknownTags = false; treatUnknownTagsAsContent = false; omitDeprecatedTags = false; treatDeprecatedTagsAsContent = false; omitComments = false; omitXmlDeclaration = OptionalOutput.alwaysOutput; omitDoctypeDeclaration = OptionalOutput.alwaysOutput; omitHtmlEnvelope = OptionalOutput.alwaysOutput; useEmptyElementTags = true; allowMultiWordAttributes = true; allowHtmlInsideAttributes = false; ignoreQuestAndExclam = true; namespacesAware = true; keepHeadWhitespace = true; addNewlineToHeadAndBody = true; hyphenReplacementInComment = "="; pruneTags = null; allowTags = null; booleanAttributeValues = BOOL_ATT_SELF; collapseNullHtml = CollapseHtml.none charset = "UTF-8"; |
void |
setAddNewlineToHeadAndBody(boolean addNewlineToHeadAndBody)
|
void |
setAdvancedXmlEscape(boolean advancedXmlEscape)
|
void |
setAllowHtmlInsideAttributes(boolean allowHtmlInsideAttributes)
|
void |
setAllowMultiWordAttributes(boolean allowMultiWordAttributes)
|
void |
setAllowTags(String allowTags)
|
void |
setBooleanAttributeValues(String booleanAttributeValues)
|
void |
setCharset(String charset)
|
void |
setCleanerTransformations(CleanerTransformations cleanerTransformations)
|
void |
setDeserializeEntities(boolean deserializeEntities)
|
void |
setHyphenReplacementInComment(String hyphenReplacementInComment)
|
void |
setIgnoreQuestAndExclam(boolean ignoreQuestAndExclam)
|
void |
setKeepWhitespaceAndCommentsInHead(boolean keepHeadWhitespace)
|
void |
setNamespacesAware(boolean namespacesAware)
|
void |
setOmitCdataOutsideScriptAndStyle(boolean value)
|
void |
setOmitComments(boolean omitComments)
|
void |
setOmitDeprecatedTags(boolean omitDeprecatedTags)
|
void |
setOmitDoctypeDeclaration(boolean omitDoctypeDeclaration)
|
void |
setOmitHtmlEnvelope(boolean omitHtmlEnvelope)
|
void |
setOmitUnknownTags(boolean omitUnknownTags)
|
void |
setOmitXmlDeclaration(boolean omitXmlDeclaration)
|
void |
setPruneTags(String pruneTags)
Resets prune tags set and adds tag name conditions to it. |
void |
setRecognizeUnicodeChars(boolean recognizeUnicodeChars)
|
void |
setTranslateSpecialEntities(boolean translateSpecialEntities)
TODO : use OptionalOutput |
void |
setTransResCharsToNCR(boolean transResCharsToNCR)
|
void |
setTransSpecialEntitiesToNCR(boolean transSpecialEntitiesToNCR)
|
void |
setTreatDeprecatedTagsAsContent(boolean treatDeprecatedTagsAsContent)
|
void |
setTreatUnknownTagsAsContent(boolean treatUnknownTagsAsContent)
|
void |
setUseCdataForScriptAndStyle(boolean useCdataForScriptAndStyle)
|
void |
setUseEmptyElementTags(boolean useEmptyElementTags)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CHARSET
public static final String BOOL_ATT_SELF
public static final String BOOL_ATT_EMPTY
public static final String BOOL_ATT_TRUE
Constructor Detail |
---|
public CleanerProperties()
public CleanerProperties(ITagInfoProvider tagInfoProvider)
tagInfoProvider
- Method Detail |
---|
public ITagInfoProvider getTagInfoProvider()
public boolean isAdvancedXmlEscape()
public void setAdvancedXmlEscape(boolean advancedXmlEscape)
public boolean isTransResCharsToNCR()
public void setTransResCharsToNCR(boolean transResCharsToNCR)
public boolean isUseCdataForScriptAndStyle()
public void setUseCdataForScriptAndStyle(boolean useCdataForScriptAndStyle)
public boolean isTranslateSpecialEntities()
public void setTranslateSpecialEntities(boolean translateSpecialEntities)
OptionalOutput
translateSpecialEntities
- public boolean isRecognizeUnicodeChars()
public void setRecognizeUnicodeChars(boolean recognizeUnicodeChars)
public boolean isOmitUnknownTags()
public void setOmitUnknownTags(boolean omitUnknownTags)
public boolean isTreatUnknownTagsAsContent()
public void setTreatUnknownTagsAsContent(boolean treatUnknownTagsAsContent)
public boolean isOmitDeprecatedTags()
public void setOmitDeprecatedTags(boolean omitDeprecatedTags)
public boolean isTreatDeprecatedTagsAsContent()
public void setTreatDeprecatedTagsAsContent(boolean treatDeprecatedTagsAsContent)
public boolean isOmitComments()
public void setOmitComments(boolean omitComments)
public boolean isOmitXmlDeclaration()
public void setOmitXmlDeclaration(boolean omitXmlDeclaration)
public boolean isOmitDoctypeDeclaration()
public void setOmitDoctypeDeclaration(boolean omitDoctypeDeclaration)
public boolean isOmitHtmlEnvelope()
public void setOmitHtmlEnvelope(boolean omitHtmlEnvelope)
public boolean isUseEmptyElementTags()
public void setUseEmptyElementTags(boolean useEmptyElementTags)
public boolean isAllowMultiWordAttributes()
public void setAllowMultiWordAttributes(boolean allowMultiWordAttributes)
public boolean isAllowHtmlInsideAttributes()
public void setAllowHtmlInsideAttributes(boolean allowHtmlInsideAttributes)
public boolean isIgnoreQuestAndExclam()
public void setIgnoreQuestAndExclam(boolean ignoreQuestAndExclam)
public boolean isNamespacesAware()
public void setNamespacesAware(boolean namespacesAware)
public boolean isAddNewlineToHeadAndBody()
public void setAddNewlineToHeadAndBody(boolean addNewlineToHeadAndBody)
public boolean isKeepWhitespaceAndCommentsInHead()
public void setKeepWhitespaceAndCommentsInHead(boolean keepHeadWhitespace)
public String getHyphenReplacementInComment()
public void setHyphenReplacementInComment(String hyphenReplacementInComment)
public String getPruneTags()
public boolean isOmitCdataOutsideScriptAndStyle()
public void setOmitCdataOutsideScriptAndStyle(boolean value)
public boolean isDeserializeEntities()
public void setDeserializeEntities(boolean deserializeEntities)
public void setPruneTags(String pruneTags)
pruneTags
- public void addPruneTagNodeCondition(ITagNodeCondition condition)
condition
- public Set<ITagNodeCondition> getPruneTagSet()
public String getAllowTags()
public void setAllowTags(String allowTags)
public boolean isTransSpecialEntitiesToNCR()
public void setTransSpecialEntitiesToNCR(boolean transSpecialEntitiesToNCR)
public Set<ITagNodeCondition> getAllowTagSet()
public void setCharset(String charset)
charset
- the charset to setpublic String getCharset()
public String getBooleanAttributeValues()
public void setBooleanAttributeValues(String booleanAttributeValues)
public void reset()
public CleanerTransformations getCleanerTransformations()
public void setCleanerTransformations(CleanerTransformations cleanerTransformations)
public void addHtmlModificationListener(HtmlModificationListener listener)
listener
- -- listener object to be notified of the changes.public void fireConditionModification(ITagNodeCondition condition, TagNode tagNode)
HtmlModificationListener
ITagNodeCondition
match.
fireConditionModification
in interface HtmlModificationListener
condition
- that was applied to make the modificationtagNode
- - problematic node.public void fireHtmlError(boolean certainty, TagNode startTagToken, ErrorType type)
HtmlModificationListener
fireHtmlError
in interface HtmlModificationListener
certainty
- - true if change made doesn't hurts end document.startTagToken
- - problematic node.public void fireUglyHtml(boolean certainty, TagNode startTagToken, ErrorType errorType)
HtmlModificationListener
fireUglyHtml
in interface HtmlModificationListener
certainty
- - true if change made doesn't hurts end document.startTagToken
- - problematic node.public void fireUserDefinedModification(boolean certainty, TagNode tagNode, ErrorType errorType)
HtmlModificationListener
fireUserDefinedModification
in interface HtmlModificationListener
certainty
- - true if change made doesn't hurts end document.tagNode
- - problematic node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |