public abstract class CompoundRule extends GrammarRule
Modifier and Type | Field and Description |
---|---|
private java.util.List<GrammarRule> |
production
The GrammarRule children of this CompoundRule.
|
protected static Filter |
textFilter
The TextFilter used by this CompoundRule.
|
identifier, parent
Modifier | Constructor and Description |
---|---|
protected |
CompoundRule(java.lang.String identifier)
Creates a CompoundRule, whose rule children are patterns to match
against a sequence of XML nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildRule(GrammarRule rule)
Adds another child GrammarRule to this CompoundRule.
|
java.util.List<GrammarRule> |
getRuleChildren()
Returns the children GrammarRules of this CompoundRule.
|
protected boolean |
hasNoText(Element node)
Checks that the tested Element contains no textual content.
|
protected boolean |
matchChildRule(Element node,
GrammarRule rule)
Matches a general GrammarRule child against an Element's children.
|
private boolean |
matchCompoundRule(Element node,
GrammarRule rule)
Seeks to match a CompoundRule against the next child or children of
the current Element.
|
private boolean |
matchElementRule(Element node,
GrammarRule rule)
Seeks to match an ElementRule against the next child of the current
Element.
|
protected java.lang.String |
toString(GrammarRule rule)
Secret method used by all CompoundRules to convert their rule children
to pretty String forms.
|
accept, clearError, getChildIndex, getIdentifier, isAttributeRule, isElementRule, isNestingRule, restrict, setChildIndex, setError, setParent, validate
protected static Filter textFilter
private java.util.List<GrammarRule> production
protected CompoundRule(java.lang.String identifier)
identifier
- the symbolic identifier of this CompoundRule.protected boolean hasNoText(Element node)
node
- an Element.protected boolean matchChildRule(Element node, GrammarRule rule)
node
- an XML Element.rule
- any child GrammarRule.private boolean matchCompoundRule(Element node, GrammarRule rule)
node
- an Element.rule
- a CompoundRule.private boolean matchElementRule(Element node, GrammarRule rule)
node
- an Element.rule
- an ElementRule.public void addChildRule(GrammarRule rule)
addChildRule
in class GrammarRule
rule
- the GrammarRule to add.public java.util.List<GrammarRule> getRuleChildren()
getRuleChildren
in class GrammarRule
protected java.lang.String toString(GrammarRule rule)
rule
- a GrammarRule child of this CompoundRule.