DLESE Tools
v1.6.0

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

java.lang.Object
  extended by 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 Summary
static int ANY
           
static int COMPOSITOR
           
static int ELEMENT
           
static int ELEMENT_REF
           
static int GROUP_REF
           
 int maxOccurs
           
 int minOccurs
           
static int UNKNOWN
           
 
Constructor Summary
CompositorMember(Element element, Compositor compositor)
          Constructor for the Member object
CompositorMember(GlobalElement globalElement)
          Construct a CompositorMember given a GlobalElement.
 
Method Summary
 int getCMtype()
          Gets the cMtype attribute of the CompositorMember object
 Element getElement()
          Gets the element attribute of the CompositorMember object
 String getInstanceQualifiedName()
          Gets the instanceQualifiedName attribute of the CompositorMember object
 String getLabel()
          Gets the label attribute of the CompositorMember object
 int getMaxInstanceElements()
          return the maximum leaf nodes this member could have
 Compositor getParentCompositor()
          Gets the parentCompositor attribute of the CompositorMember object
 CompositorGuard getParentCompositorGuard()
          Gets the parentCompositorGuard attribute of the CompositorMember object
 String getQualifiedName()
          Gets the qualifiedName attribute of the CompositorMember object
 InlineCompositor getSubCompositor()
          Returns this Member's inline compositor (Choice, Sequence, All) if there is one.
 List getSubstitutionGroupMemberNames()
          Gets the instanceQualifiedNames of the substitutionGroupMembers, if this Member is a headElement.
 List getSubstitutionGroupMembers()
          If this CompositorMember represents a HeadElement (a globalElement having a substitutionGroup, then return the substitutionGroup as a list of GlobalElements.
 boolean hasSubCompositor()
          Description of the Method
 boolean isHeadElement()
          Is this member a headElement (having a substitutionGroup that specifies element names that can be subsituted for this member.
static void prtln(String s)
          NOT YET DOCUMENTED
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT

public static final int ELEMENT
See Also:
Constant Field Values

ELEMENT_REF

public static final int ELEMENT_REF
See Also:
Constant Field Values

GROUP_REF

public static final int GROUP_REF
See Also:
Constant Field Values

COMPOSITOR

public static final int COMPOSITOR
See Also:
Constant Field Values

ANY

public static final int ANY
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

minOccurs

public int minOccurs

maxOccurs

public int maxOccurs
Constructor Detail

CompositorMember

public CompositorMember(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 Detail

getMaxInstanceElements

public int getMaxInstanceElements()
return the maximum leaf nodes this member could have

Returns:
The maxInstanceElements value

getElement

public 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

DLESE Tools
v1.6.0