Class CompositorMember

java.lang.Object
org.dlese.dpc.xml.schema.compositor.CompositorMember

public class CompositorMember extends Object
Represents a *Member* of the Compositor (e.g., All, Sequence, or Choice) specified in ComplexType definition.

Compositor Members are created at schema-processing time, but used to provide run-time services. For example, at run time, the compositor is used, along with the CompositorGuard instance, to determine if a child element may be added to an existing instance document. In order to serve run-time purposes, the Compositor members must be accessible via qualified element names as they appear in the instance document. The instance-level namespace prefix might be different from that associated with the compositor members in the schema file in which they were defined.

Author:
Jonathan Ostwald
  • Field Details

  • Constructor Details

    • CompositorMember

      public CompositorMember(org.dom4j.Element element, Compositor compositor)
      Constructor for the Member object
      Parameters:
      element - Schema Element representing this member
      compositor - the compositor instance of which this is a member
    • CompositorMember

      public CompositorMember(GlobalElement globalElement)
      Construct a CompositorMember given a GlobalElement.

      This constructor is used to create CompositorMembers from the GlobalElements stored as substitutionGroup of a headElement (see Compositor.getSubstitionGroupMembers).

      Global elements may not have occurrance information. The the qualifiedName should already be in the top-level namespace context, but for now leave getInstanceQualifiedName alone, rather than assign it here as we do with qualifiedName.

      Parameters:
      globalElement - Description of the Parameter
  • Method Details

    • getMaxInstanceElements

      public int getMaxInstanceElements()
      return the maximum leaf nodes this member could have
      Returns:
      The maxInstanceElements value
    • getElement

      public org.dom4j.Element getElement()
      Gets the element attribute of the CompositorMember object
      Returns:
      The element value
    • hasSubCompositor

      public boolean hasSubCompositor()
      Description of the Method
      Returns:
      Description of the Return Value
    • getSubstitutionGroupMembers

      public List getSubstitutionGroupMembers()
      If this CompositorMember represents a HeadElement (a globalElement having a substitutionGroup, then return the substitutionGroup as a list of GlobalElements. Otherwise return an empty List.

      NOTE: evaluation of substitutionGroupMembers is lazy - it must be performed AFTER all the GlobalDefs in the schema have been created, otherwise there is a chance that the globalElement, if one exists, will not be found in the GlobalDefMap.

      Returns:
      The substitutionGroupMembers value
    • getSubstitutionGroupMemberNames

      public List getSubstitutionGroupMemberNames()
      Gets the instanceQualifiedNames of the substitutionGroupMembers, if this Member is a headElement.
      Returns:
      InstanceQualifiedNames of this Members substitutionGroupMembers
    • isHeadElement

      public boolean isHeadElement()
      Is this member a headElement (having a substitutionGroup that specifies element names that can be subsituted for this member.
      Returns:
      The headElement value
    • getSubCompositor

      public InlineCompositor getSubCompositor()
      Returns this Member's inline compositor (Choice, Sequence, All) if there is one.
      Returns:
      The subCompositor value
    • getParentCompositor

      public Compositor getParentCompositor()
      Gets the parentCompositor attribute of the CompositorMember object
      Returns:
      The parentCompositor value
    • getParentCompositorGuard

      public CompositorGuard getParentCompositorGuard()
      Gets the parentCompositorGuard attribute of the CompositorMember object
      Returns:
      The parentCompositorGuard value
    • getInstanceQualifiedName

      public String getInstanceQualifiedName()
      Gets the instanceQualifiedName attribute of the CompositorMember object
      Returns:
      The instanceQualifiedName value
    • getQualifiedName

      public String getQualifiedName()
      Gets the qualifiedName attribute of the CompositorMember object
      Returns:
      The qualifiedName value
    • getLabel

      public String getLabel()
      Gets the label attribute of the CompositorMember object
      Returns:
      The label value
    • getCMtype

      public int getCMtype()
      Gets the cMtype attribute of the CompositorMember object
      Returns:
      The cMtype value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • prtln

      public static void prtln(String s)
      NOT YET DOCUMENTED
      Parameters:
      s - NOT YET DOCUMENTED