DLESE Tools
v1.6.0

org.dlese.dpc.xml.schema.compositor
Class Choice

java.lang.Object
  extended by org.dlese.dpc.xml.schema.compositor.Compositor
      extended by org.dlese.dpc.xml.schema.compositor.Choice

public class Choice
extends Compositor

Class representing the Choice compositor.

Author:
ostwald

Field Summary
 
Fields inherited from class org.dlese.dpc.xml.schema.compositor.Compositor
ALL, anyTypeMember, CHOICE, element, instanceNamespaces, leafMembers, localNamespaces, maxOccurs, members, minOccurs, name, parent, SEQUENCE, UNKNOWN
 
Constructor Summary
Choice(ComplexType parent)
           
Choice(ComplexType parent, Element e)
           
 
Method Summary
 boolean acceptsNewMember(Element instanceElement)
          Returns true if there is room in instanceElement any new member within the constraints of the schema.
 boolean acceptsNewMember(Element instanceElement, String memberName, int memberIndex)
          NOT YET DOCUMENTED
 List getAcceptableMembers(Element instanceElement)
          Returns the members that could be added to the specified instanceElement according to schema constraints.
 List getChoiceNames()
           
 int getType()
          Returns an integer contant that specifies whether this Compositor is Sequence, Choice, All.
 boolean isRequiredChoice()
          Returns true if instances of this compositor Must have at least one member.
protected static void prtln(String s)
           
 String toString()
          Description of the Method
 
Methods inherited from class org.dlese.dpc.xml.schema.compositor.Compositor
getAnyTypeMember, getElement, getIndexOfMember, getIndexOfMember, getInstanceNames, getLeafMember, getLeafMemberNames, getLeafMembers, getMaxInstanceElements, getMaxOccurs, getMember, getMemberAt, getMemberNames, getMembers, getMinOccurs, getName, getParent, getSubstitionGroupMembers, getSubstitionGroupNames, hasAnyTypeMember, hasMember, init, occursInfo, printInstanceNames, printLeafMemberNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Choice

public Choice(ComplexType parent)

Choice

public Choice(ComplexType parent,
              Element e)
Method Detail

acceptsNewMember

public boolean acceptsNewMember(Element instanceElement)
Returns true if there is room in instanceElement any new member within the constraints of the schema.

Specified by:
acceptsNewMember in class Compositor
Parameters:
instanceElement - NOT YET DOCUMENTED
Returns:
The simpleType value

acceptsNewMember

public boolean acceptsNewMember(Element instanceElement,
                                String memberName,
                                int memberIndex)
Description copied from class: Compositor
NOT YET DOCUMENTED

Specified by:
acceptsNewMember in class Compositor
Parameters:
instanceElement - NOT YET DOCUMENTED
memberName - NOT YET DOCUMENTED
memberIndex - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

isRequiredChoice

public boolean isRequiredChoice()
Returns true if instances of this compositor Must have at least one member. A Choice compositor need not have a member if the compositor has minOccurs of 0 OR if one of the choices has minOccurs of 0.

NOTE: this is much simpler than calculating how many members are ultimately required ....


getAcceptableMembers

public List getAcceptableMembers(Element instanceElement)
Returns the members that could be added to the specified instanceElement according to schema constraints.


getType

public int getType()
Description copied from class: Compositor
Returns an integer contant that specifies whether this Compositor is Sequence, Choice, All.

Overrides:
getType in class Compositor
Returns:
The dataType value

getChoiceNames

public List getChoiceNames()

toString

public String toString()
Description of the Method

Overrides:
toString in class Compositor
Returns:
Description of the Return Value

prtln

protected static void prtln(String s)

DLESE Tools
v1.6.0