public class IgnoreElementRule extends Object
TagStack
.
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.Constructor and Description |
---|
IgnoreElementRule(Predicate<IgnoreElementRule> tagContextPredicate,
boolean isActive)
Default constructor for an IgnoreElementRule.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getRuleContext() |
TagContext |
getTagContext() |
boolean |
isActive() |
boolean |
isBeginElement() |
void |
switchRule(TagContext tagContext,
boolean begin)
Switch the active value (see
isActive() if the predicate of the rule match the given tagContext. |
public IgnoreElementRule(Predicate<IgnoreElementRule> tagContextPredicate, boolean isActive)
tagContextPredicate
- the predicate used to switch the active flag.isActive
- the default flag to set the rule as active or not.public boolean isActive()
public TagContext getTagContext()
public boolean isBeginElement()
public Map<String,Object> getRuleContext()
public void switchRule(TagContext tagContext, boolean begin)
isActive()
if the predicate of the rule match the given tagContext.tagContext
- The tag context which can match the predicate.begin
- true indicates that it's the begin tag which called the predicateCopyright © 2004–2021 XWiki. All rights reserved.