public class UnorderedRule extends CompoundRule
An UnorderedRule is created for the XSD complex type specifier
xs:all
. The optional flag is also set if the multiplicity
attribute xs:minOccurs
is set to zero.
Modifier and Type | Field and Description |
---|---|
private boolean |
optional
A flag indicating whether the children rules are optional.
|
textFilter
identifier, parent
Constructor and Description |
---|
UnorderedRule()
Creates an UnorderedRule, whose rule children are patterns to match in
any order, exactly once.
|
UnorderedRule(boolean optional)
Creates an UnorderedRule, whose rule children are patterns to match in
any order, at most once.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Element node)
Reports whether this UnorderedRule accepts an Element with an
unordered child pattern.
|
void |
addChildRule(GrammarRule rule)
Adds another child GrammarRule to this UnordreredRule.
|
private boolean |
matchAllChildren(Element node)
The matching algorithm for an UnorderedRule.
|
private GrammarRule |
matchAnyUnused(Element node,
java.util.List<GrammarRule> unusedRules)
The auxiliary algorithm seeking to match any so-far unused GrammarRule.
|
void |
setOptional(boolean optional)
Sets the optional flag of this UnorderedRule.
|
java.lang.String |
toString()
Returns a pretty representation of this UnorderedRule.
|
getRuleChildren, hasNoText, matchChildRule, toString
clearError, getChildIndex, getIdentifier, isAttributeRule, isElementRule, isNestingRule, restrict, setChildIndex, setError, setParent, validate
private boolean optional
public UnorderedRule()
public UnorderedRule(boolean optional)
optional
- true, to allowprivate boolean matchAllChildren(Element node)
node
- an Element.private GrammarRule matchAnyUnused(Element node, java.util.List<GrammarRule> unusedRules)
node
- an Element.unusedRules
- a list of so-far unused GrammarRules.public boolean accept(Element node)
accept
in class GrammarRule
node
- the parent Element.public void addChildRule(GrammarRule rule)
addChildRule
in class CompoundRule
rule
- the child rule to add.public void setOptional(boolean optional)
optional
- true, to enable optional matching.public java.lang.String toString()
toString
in class java.lang.Object