Class IgnoreElementRule
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.xhtml.impl.IgnoreElementRule
-
public class IgnoreElementRule extends Object
Define a rule to know if the elements should be ignored inTagStack
. If the rule is active, then all the elements should be ignored. But if a given element match the given predicate then the active status is switched.- Since:
- 10.10RC1
- Version:
- $Id: 2e0e065506a0bf288ae5971db40b88aa92b87fec $
-
-
Constructor Summary
Constructors Constructor Description IgnoreElementRule(Predicate<IgnoreElementRule> tagContextPredicate, boolean isActive)
Default constructor for an IgnoreElementRule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getRuleContext()
TagContext
getTagContext()
boolean
isActive()
boolean
isBeginElement()
void
switchRule(TagContext tagContext, boolean begin)
Switch the active value (seeisActive()
if the predicate of the rule match the given tagContext.
-
-
-
Constructor Detail
-
IgnoreElementRule
public IgnoreElementRule(Predicate<IgnoreElementRule> tagContextPredicate, boolean isActive)
Default constructor for an IgnoreElementRule.- Parameters:
tagContextPredicate
- the predicate used to switch the active flag.isActive
- the default flag to set the rule as active or not.
-
-
Method Detail
-
isActive
public boolean isActive()
- Returns:
- if true the elements will be ignored.
-
getTagContext
public TagContext getTagContext()
- Returns:
- the tag context that is used for switching rule.
- Since:
- 11.4RC1
-
isBeginElement
public boolean isBeginElement()
- Returns:
- true if we are in a begin element. This can be used inside the predicate to activate the rule.
- Since:
- 11.4RC1
-
getRuleContext
public Map<String,Object> getRuleContext()
- Returns:
- a mutable rule context to allow get/set information that could be used for the predicate.
- Since:
- 11.4RC1
-
switchRule
public void switchRule(TagContext tagContext, boolean begin)
Switch the active value (seeisActive()
if the predicate of the rule match the given tagContext.- Parameters:
tagContext
- The tag context which can match the predicate.begin
- true indicates that it's the begin tag which called the predicate
-
-