Class ChoiceGuard
java.lang.Object
org.dlese.dpc.xml.schema.compositor.CompositorGuard
org.dlese.dpc.xml.schema.compositor.ChoiceGuard
CompositorGuard for the Choice compositor.
- Author:
- ostwald
-
Field Summary
Fields inherited from class org.dlese.dpc.xml.schema.compositor.CompositorGuard
instanceMembers -
Constructor Summary
ConstructorsConstructorDescriptionChoiceGuard(Compositor compositor, List instanceList) ChoiceGuard(Compositor compositor, org.dom4j.Element instanceElement) Constructor for the ChoiceGuard object -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if a new member may be added.booleanNOTE: if any of the choice compositor members has a minOccurs of 0, then there need not be any occurrances!Returns a list of element names representing the choices that can be legally made.protected ListReturns 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 voidNOT YET DOCUMENTEDMethods inherited from class org.dlese.dpc.xml.schema.compositor.CompositorGuard
acceptsNewMember, findOccurence, findOccurrence, getCompositor, getInstance, getOccurrencesCount, getOccurrencesCount, getSubOccurrenceCount, printInstanceMembers, printOccurrences, resolveLeafNameToCM, resolveLeafNameToCMName, toString
-
Constructor Details
-
ChoiceGuard
Constructor for the ChoiceGuard object- Parameters:
compositor- NOT YET DOCUMENTEDinstanceElement- NOT YET DOCUMENTED
-
ChoiceGuard
-
-
Method Details
-
getAcceptableMembers
Returns a list of element names representing the choices that can be legally made.- Returns:
- The acceptableMembers value
-
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.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
- Specified by:
getOccurrencesin classCompositorGuard- Returns:
- The occurrences value
- Throws:
Exception- NOT YET DOCUMENTED
-
checkValid
NOTE: if any of the choice compositor members has a minOccurs of 0, then there need not be any occurrances!- Overrides:
checkValidin classCompositorGuard- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
acceptsNewMember
public boolean acceptsNewMember()Returns true if a new member may be added.Takes into account whether there is a legal choice to be made, as well as the maxOccurs constraint of the compositor.
- Overrides:
acceptsNewMemberin classCompositorGuard- Returns:
- NOT YET DOCUMENTED
-
prtln
NOT YET DOCUMENTED- Parameters:
s- NOT YET DOCUMENTED
-