public class ChoiceGuard extends CompositorGuard
instanceMembers
Constructor and Description |
---|
ChoiceGuard(Compositor compositor,
org.dom4j.Element instanceElement)
Constructor for the ChoiceGuard object
|
ChoiceGuard(Compositor compositor,
java.util.List instanceList) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsNewMember()
Returns true if a new member may be added.
|
boolean |
checkValid()
NOTE: if any of the choice compositor members has a minOccurs of 0, then there need not be any occurrances!
|
java.util.List |
getAcceptableMembers()
Returns a list of element names representing the choices that can be legally made.
|
protected java.util.List |
getOccurrences()
Returns a list of occurrence instances that can be used to determine
whether an instance document element satisfies the occurrence constraints
of the schema.
|
protected static void |
prtln(java.lang.String s)
NOT YET DOCUMENTED
|
acceptsNewMember, findOccurence, findOccurrence, getCompositor, getInstance, getOccurrencesCount, getOccurrencesCount, getSubOccurrenceCount, printInstanceMembers, printOccurrences, resolveLeafNameToCM, resolveLeafNameToCMName, toString
public ChoiceGuard(Compositor compositor, org.dom4j.Element instanceElement)
compositor
- NOT YET DOCUMENTEDinstanceElement
- NOT YET DOCUMENTEDpublic ChoiceGuard(Compositor compositor, java.util.List instanceList)
public java.util.List getAcceptableMembers()
protected java.util.List getOccurrences() throws java.lang.Exception
Walk down the buckets, when there is no room to add the current member, start an new occurrance. NOTE: the order in which we add members is aribitrary - we just can't overfill any single member.
NOTE: this does not account for many of the children choice compositors can have: - choice - sequence - any - element - group
getOccurrences
in class CompositorGuard
java.lang.Exception
- NOT YET DOCUMENTEDpublic boolean checkValid() throws java.lang.Exception
checkValid
in class CompositorGuard
java.lang.Exception
- NOT YET DOCUMENTEDpublic boolean acceptsNewMember()
Takes into account whether there is a legal choice to be made, as well as the maxOccurs constraint of the compositor.
acceptsNewMember
in class CompositorGuard
protected static void prtln(java.lang.String s)
s
- NOT YET DOCUMENTED